To list the WMI namespaces directly below root, run Get-CimInstance -Namespace root -ClassName __Namespace. To see the namespace hierarchy rather than just that first level, enumerate recursively from root; WMI namespaces are hierarchical, so a single query does not list every descendant.
List the namespaces directly under root
In PowerShell, run:
Get-CimInstance -Namespace root -ClassName __Namespace
This queries the __Namespace system class in the root namespace and returns its immediate child namespaces. Each returned instance has a Name property containing the child namespace’s name. Microsoft describes __Namespace as the class that represents a WMI namespace in its __Namespace class reference.
To print only the names, use:
Get-CimInstance -Namespace root -ClassName __Namespace | Select-Object -ExpandProperty Name
Specify -Namespace root explicitly: Get-CimInstance defaults to root/CIMV2, so omitting the parameter queries a different part of the hierarchy. The cmdlet’s Microsoft documentation includes the root-namespace example.
Enumerate the full namespace hierarchy
The command above lists one level only. To find descendants nested beneath those children, query each namespace in turn. Microsoft’s WMI overview explains that namespaces form a hierarchy and that a complete inventory requires a recursive query starting at root.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
For example, this PowerShell function recursively visits child namespaces and emits their paths:
function Get-WmiNamespaceTree {
param([string]$Namespace = 'root')
Get-CimInstance -Namespace $Namespace -ClassName __Namespace |
ForEach-Object {
$child = "$Namespace/$($_.Name)"
$child
Get-WmiNamespaceTree -Namespace $child
}
}
Get-WmiNamespaceTree
The output is a list of paths, such as root/ChildNamespace, followed by any descendants found under them. The results depend on the computer or WMI server queried and its installed providers; there is no universal fixed list that applies to every system.
Rank #2
- Book - powershell for sysadmins: workflow automation made easy
- Language: english
- Binding: paperback
To inspect children under a different branch, pass that namespace as the starting point, for example root/CIMV2/Applications. The returned instances still represent only that namespace’s direct children unless you recurse further.
Use the current CIM cmdlet, not the legacy WMI cmdlet
Use Get-CimInstance for current PowerShell instructions. Microsoft says Get-WmiObject was superseded beginning with Windows PowerShell 3.0. Its cmdlet documentation and the legacy recursive sample may help when maintaining older scripts, but that sample is not the recommended current approach.
Rank #3
What WMI namespaces are—and are not
A WMI namespace is a logical database that organizes WMI classes and providers; it is not a filesystem folder. WMI providers are also distinct from Windows PowerShell providers. This distinction matters when interpreting the output: the command reports WMI namespaces exposed by the target WMI server, not PowerShell drives or folders.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




