Contact Info

Crumbtrail » Administration » Powershell » Powershell 1.0 » Get-WMIobject

Get-WMIobject - Powershell 1.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Get WMI class information

Get-WmiObject [-namespace string]
         [-computerName string[]]
            [-credential PSCredential] [-list] [CommonParameters]

      Get-WmiObject [-class] string [[-property] string[]] [-namespace string]
          [-computerName string[]] [-filter string]
             [-credential PSCredential] [CommonParameters]

      Get-WmiObject -query string [-namespace string]
          [-computerName string[]]
             [-credential PSCredential] [CommonParameters]

       The name of a WMI class.

       A WMI class property (or set of properties) to retrieve.

   -namespace string
       The WMI repository namespace.

       List the names of the WMI classes.
       If you don't specify the -Namespace parameter, then root\CIMV2 
       will be used by default.

   -computerName string[]
       The computer(s) to run against.
       A NETBIOS name, an IP address, full domain name or local (.)
       WMI information is retrieved via the WMI Service (CIMOM)
       on the specified computers.

   -filter string
       A where clause to use as a filter. Use the syntax of the WQL language.
       Do not include the WHERE keyword.
   -query string
       A WMI Query Language (WQL) statement to run. 
       Event queries are not supported.

   -credential PSCredential
       Use the specified credential to authenticate the user. Type a user name  
       or submit a credential object (created with Get-Credential)
       If you supply a user name, you will be prompted for a password.

       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutVariable.

Display information about all processes:

PS C:\>get-wmiobject win32_process

Display information about all processes running on the machine 'Server64':

PS C:\>get-wmiobject win32_service -computername Server64

As above but passing credentials:

PS C:\>get-wmiobject win32_service -credential SS64\Simon -computer Server64

Display information about the Alerter service:

PS C:\>get-wmiobject -query "select * from win32_service where name='alerter'"

Stop the Alerter service:

PS C:\>(get-wmiobject win32_service -filter "name='alerter'").StopService()

Display all WMI classes in the root/default namespace:

PS C:\>get-wmiobject -namespace "root/default" -list

Display BIOS and Memory information:

PS C:\>get-wmiobject win32_bios | format-list *
PS C:\>get-wmiobject Win32_ComputerSystem
PS C:\>get-wmiobject Win32_PhysicalMemory