Thursday, February 23, 2012
   
Text Size

PowerShell - Get Remote Computer Name

 

Windows PowerShell - Get Remote Computer Name

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"
"Machine Name: " + $CS.Name