Listing All WMI Namespaces

by May 14, 2012

WMI is organized into namespaces which work similar to subfolders. Here's a line that lists all namespaces you got:

PS> Get-WmiObject -Query "Select * from __Namespace" -Namespace Root | Select-O    bject -ExpandProperty Name

Next, you could investigate all classes that live in one of these particular namespaces:

PS> Get-WmiObject -Namespace SecurityCenter2 -List 

And then, once you know the classes, you could retrieve information, for example, about your installed AntiVirus protection:

PS>  Get-WmiObject -Namespace root\SecurityCenter2 -Class AntivirusProduct
__GENUS                  : 2
__CLASS : AntiVirusProduct
__DYNASTY : AntiVirusProduct
__RELPATH : AntiVirusProduct.instanceGuid="{108DAC43-C256-20B7-BB05-914135
__NAMESPACE : ROOT\SecurityCenter2
__PATH : \\TOBIASAIR1\ROOT\SecurityCenter2:AntiVirusProduct.instanceGui
displayName : Microsoft Security Essentials
instanceGuid : {108DAC43-C256-20B7-BB05-914135DA5160}
pathToSignedProductExe : C:\Program Files\Microsoft Security Client\msseces.exe
pathToSignedReportingExe : C:\Program Files\Microsoft Security
productState : 397312
PSComputerName : TOBIASAIR1

Twitter This Tip! ReTweet this Tip!