Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk2 min

How to List WMI Namespaces in PowerShell

List the WMI namespaces directly under root with Get-CimInstance, or use a recursive PowerShell function to inventory descendants.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
Sale
PowerShell for Sysadmins: Workflow Automation Made Easy
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.