Accessing Servers Remotely via WMI

by Mar 12, 2009

WMI is a fantastic source of information! Best of all, it works locally as well as remotely. For example, the next line gives you details about your operating system:

Get-WMIObject Win32_OperatingSystem

Use the parameter -computer like this to get the very same information from a remote system:

Get-WMIObject Win32_OperatingSystem -computer TestSystem123

Simply specify the computer name or an IP address and make sure you have appropriate privileges and that no firewall is blocking WMI or RPC. If you need to log-on to the target machine as a different user, add the -credential parameter:

$cred = Get-Credential
Get-WMIObject Win32_OperatingSystem -computer TestSystem123 -credential $cred