{"id":74210,"date":"2015-02-02T11:59:00","date_gmt":"2015-02-02T11:59:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2015\/02\/02\/powertip-use-poweshell-to-search-for-cim-classes\/"},"modified":"2019-02-18T10:35:38","modified_gmt":"2019-02-18T17:35:38","slug":"powertip-use-poweshell-to-search-for-cim-classes","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/powertip-use-poweshell-to-search-for-cim-classes\/","title":{"rendered":"PowerTip: Use PoweShell to Search for CIM Classes"},"content":{"rendered":"<p><b style=\"font-size:12px\">Summary<\/b><span style=\"font-size:12px\">: Learn how to use Windows PowerShell to search for CIM classes.<\/span>\n<img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Question\">&nbsp;How can I use Windows PowerShell to find a CIM class on my machine?<\/p>\n<p style=\"margin-left:30px\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" alt=\"Hey, Scripting Guy! Answer\">&nbsp;Use&nbsp;<b>Get-WmiObject<\/b>&nbsp;in&nbsp;<b>List<\/b>&nbsp;mode. For instance, to find the class for working with the registry, use:<\/p>\n<p style=\"margin-left:120px\">Get-WmiObject -Namespace root -Class StdRegProv -List &ndash;Recurse<\/p>\n<p style=\"margin-left:60px\"><b>&nbsp; &nbsp; &nbsp;Note<\/b>&nbsp;If you don&rsquo;t know where a class can be found, always start at the root.<\/p>\n<p style=\"margin-left:60px\">If you want to find the classes for working with disks:<\/p>\n<p style=\"margin-left:120px\">Get-WmiObject -Namespace root -Class *disk* -List -Recurse<\/p>\n<p style=\"margin-left:60px\">If you know the namespace, you can simplify the search:<\/p>\n<p style=\"margin-left:120px\">Get-WmiObject -Namespace rootcimv2 -Class *disk* -List &ndash;Recurse<\/p>\n<p style=\"margin-left:60px\"><b>&nbsp; &nbsp; &nbsp;Note<\/b>&nbsp;If you don&rsquo;t provide a namespace, the default of&nbsp;<b>rootcimv2<\/b>&nbsp;is used.<\/p>\n<p style=\"margin-left:60px\">When you find likely classes, use&nbsp;<b>Get-CimClass<\/b>&nbsp;to investigate details.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Learn how to use Windows PowerShell to search for CIM classes. &nbsp;How can I use Windows PowerShell to find a CIM class on my machine? &nbsp;Use&nbsp;Get-WmiObject&nbsp;in&nbsp;List&nbsp;mode. For instance, to find the class for working with the registry, use: Get-WmiObject -Namespace root -Class StdRegProv -List &ndash;Recurse &nbsp; &nbsp; &nbsp;Note&nbsp;If you don&rsquo;t know where a class [&hellip;]<\/p>\n","protected":false},"author":596,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[385,356,26,189,45],"class_list":["post-74210","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-cim","tag-powertip","tag-registry","tag-richard-siddaway","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>Summary: Learn how to use Windows PowerShell to search for CIM classes. &nbsp;How can I use Windows PowerShell to find a CIM class on my machine? &nbsp;Use&nbsp;Get-WmiObject&nbsp;in&nbsp;List&nbsp;mode. For instance, to find the class for working with the registry, use: Get-WmiObject -Namespace root -Class StdRegProv -List &ndash;Recurse &nbsp; &nbsp; &nbsp;Note&nbsp;If you don&rsquo;t know where a class [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/74210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/596"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=74210"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/74210\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=74210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=74210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=74210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}