February 28th, 2014

PowerTip: Search All WMI Namespaces with PowerShell

Doctor Scripto
Scripter

Summary: Learn to look for WMI classes in all WMI namespaces by using Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to search all WMI namespaces so that
          I can find all WMI classes that are related to batteries?

Hey, Scripting Guy! Answer Use the Get-WmiObject cmdlet, start at the Root namespace, and make sure to use the –recurse switch:

Get-WMIObject -Namespace root -ClassName *battery* -list -recurse -EA 0

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.