Thursday, February 23, 2012
   
Text Size

PowerShell - Get Remote Computer Logged On UserName

 

Windows PowerShell - Get Remote Computer Name Logged On UserName

windows_powershell

 To get a remote Computer Name 'kinda pointless as you have to know the name before you can query it - but what the hell' -

Replace "COMPUTERNAME" with the name of the computer:

$CS = Gwmi Win32_ComputerSystem -Comp "COMPUTERNAME"
"Logged On User: " + $CS.UserName