Accessing Servers Remotely via WMI

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

Posted Mar 12 2009, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.