Se hostname of connected/logged in computer?

I’m wondering if it’s possible to se the remote computers hostname? I can’t figure it out.
I did try to resolve the IPno from the $RemoteIpAddress but it’s not optimal.
Anyone that have any better solution?

Product: PowerShell Universal
Version: 2.9.3

It’s not something the browser is supplying in the headers.
but, I guess you could extract it from the windows eventlog (if running on windows).
it depend on which authentication protocol you use, on where to extract the event log from.
if’s your using Claims, maybe it’s possible to add the local PC in the claim, if the Authentication point support that.

You might also be able to pull it from the local DNS cache

(Get-DnsClientCache -Data $RemoteIpAddress).Entry