pwsh..WMI

Namespaces

Listing all Namespaces

# create a new queue
$namespaces = [System.Collections.Queue]::new()

# add an initial namespace to the queue
# any namespace in the queue will later be processed
$namespaces.Enqueue('root')

# process all elements on the queue until all are taken
While ($namespaces.Count -gt 0 -and ($current = $namespaces.Dequeue()))
{
    # find child namespaces
    Get-CimInstance -Namespace $current -ClassName __Namespace -ErrorAction Ignore |
    # ignore localization namespaces
    Where-Object Name -NotMatch '^ms_\d{2}' |
    ForEach-Object {
        # construct the full namespace name
        $childnamespace = '{0}\{1}' -f $current, $_.Name
        # add namespace to queue
        $namespaces.Enqueue($childnamespace)
    }

    # output current namespace
    $current
}

List class name for a namespace

# list all classes that live in namespace "root\cimv2"...
Get-CimClass -Namespace 'root\cimv2' | 
# take only the class name...
Select-Object -ExpandProperty CimClassName | 
# and sort the output:
Sort-Object

Namespace list – AVDSysadmin-02

root
root\subscription
root\DEFAULT
root\CIMV2
root\msdtc
root\Cli
root\SECURITY
root\SecurityCenter2
root\RSOP
root\PEH
root\StandardCimv2
root\WMI
root\directory
root\Policy
root\Interop
root\Hardware
root\ServiceModel
root\SecurityCenter
root\Microsoft
root\Appv
root\CIMV2\mdm
root\CIMV2\Security
root\CIMV2\power
root\CIMV2\TerminalServices
root\RSOP\NS2833FCCF_8521_4E95_AF52_2B4CF0923E08
root\RSOP\NS3B793455_4245_4472_9B96_046A96C88E4F
root\RSOP\User
root\RSOP\NS223915A7_32CA_42C3_A0BC_557328100429
root\RSOP\Computer
root\RSOP\NS00B938EC_F037_4A8A_AF06_F4F39B49C342
root\RSOP\NS8F34ECE9_B655_46F4_8003_820E4FE4C62F
root\StandardCimv2\embedded
root\directory\LDAP
root\Microsoft\HomeNet
root\Microsoft\protectionManagement
root\Microsoft\Windows
root\Microsoft\SecurityClient
root\Microsoft\Uev
root\CIMV2\mdm\dmmap
root\CIMV2\Security\MicrosoftTpm
root\CIMV2\Security\MicrosoftVolumeEncryption
root\RSOP\NS2833FCCF_8521_4E95_AF52_2B4CF0923E08\Computer
root\RSOP\NS3B793455_4245_4472_9B96_046A96C88E4F\User
root\RSOP\NS3B793455_4245_4472_9B96_046A96C88E4F\Computer
root\RSOP\User\S_1_5_21_3795181631_1904560512_265886880_45614
root\RSOP\User\S_1_5_21_3795181631_1904560512_265886880_26243
root\RSOP\User\S_1_5_21_3795181631_1904560512_265886880_32747
root\RSOP\NS223915A7_32CA_42C3_A0BC_557328100429\User
root\RSOP\NS223915A7_32CA_42C3_A0BC_557328100429\Computer
root\RSOP\NS00B938EC_F037_4A8A_AF06_F4F39B49C342\User
root\RSOP\NS00B938EC_F037_4A8A_AF06_F4F39B49C342\Computer
root\RSOP\NS8F34ECE9_B655_46F4_8003_820E4FE4C62F\User
root\RSOP\NS8F34ECE9_B655_46F4_8003_820E4FE4C62F\Computer
root\Microsoft\Windows\RemoteAccess
root\Microsoft\Windows\Dns
root\Microsoft\Windows\Powershellv3
root\Microsoft\Windows\DeviceGuard
root\Microsoft\Windows\TaskScheduler
root\Microsoft\Windows\DesiredStateConfigurationProxy
root\Microsoft\Windows\SmbWitness
root\Microsoft\Windows\Wdac
root\Microsoft\Windows\winrm
root\Microsoft\Windows\AppBackgroundTask
root\Microsoft\Windows\PS_MMAgent
root\Microsoft\Windows\Storage
root\Microsoft\Windows\HardwareManagement
root\Microsoft\Windows\SMB
root\Microsoft\Windows\EventTracingManagement
root\Microsoft\Windows\DesiredStateConfiguration
root\Microsoft\Windows\CI
root\Microsoft\Windows\DeliveryOptimization
root\Microsoft\Windows\Defender
root\Microsoft\Windows\RemoteAccess\Client
root\Microsoft\Windows\Storage\PT
root\Microsoft\Windows\Storage\Providers_v2
root\Microsoft\Windows\Storage\PT\Alt