Home > Back-end >  How can i list namespaces under the root?
How can i list namespaces under the root?

Time:10-27

I want to list which things are useable under \\root\ .However i don't know how to list or see which things i can use.Because,i am beginner in the powershell.

I am coding this thing: wmic /namespace:\root\ (But i don't know which things i can use under root.And because of this, i cannot use anything :/)

How can i list which things could be useable under root ? If someone can help, i will be really happy :D

I tried use "/?" but it didn't help.Also i researched on google BUT again i couldn't find something useful for myself or maybe i couldn't understand their solutions.

CodePudding user response:

There is a WMI class of __namespace you can query:

Get-WmiObject -Namespace Root -Class __Namespace | Select Name

Name           
----           
subscription   
DEFAULT        
CIMV2          
msdtc          
Cli            
SECURITY       
SecurityCenter2
RSOP           
PEH            
StandardCimv2  
WMI            
MSPS           
directory      
Policy         
Interop        
Hardware       
ServiceModel   
SecurityCenter 
Microsoft      
Appv           

I would recommend reading through about WMI. It covers some of the discoverability aspects, which are important because:

In a default installation of Windows 8, there are more than 1,100 WMI classes in Root/Cimv2


Newer versions of powershell use CIM over WMI with commands like Get-CimInstance. It's not worth worrying about for now, but it's good to look into while you're learning

WMIC is a separate exe from powershell, and doesn't return powershell objects. I would avoid it unless you're stuck to command prompt

  • Related