Working Remotely With WMI

by May 13, 2009

PowerShell v1 has no support for working remotely but WMI natively is able to work on local or remote machines. Simply use the -computername parameter to access remote systems. You can provide an IP address, a NetBIOS name and even a comma-separated list of multiple names:

Get-WMIObject Win32_BIOS -computername 192.168.2.102

If you receive a "RPC server not available" exception, then the system is blocked by a firewall or not online. If you receive an "access denied" exception, then you do not have local admin rights on the target machine. You can however authenticate yourself with different credentials:

Get-WMIObject Win32_BIOS -computername 192.168.2.102 `
-credential (Get-Credential)