{"id":5044,"date":"2012-09-01T00:01:00","date_gmt":"2012-09-01T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2012\/09\/01\/weekend-scripter-discover-the-power-of-wmi-and-powershell\/"},"modified":"2012-09-01T00:01:00","modified_gmt":"2012-09-01T00:01:00","slug":"weekend-scripter-discover-the-power-of-wmi-and-powershell","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/weekend-scripter-discover-the-power-of-wmi-and-powershell\/","title":{"rendered":"Weekend Scripter: Discover the Power of WMI and PowerShell"},"content":{"rendered":"<p><b>Summary<\/b>: Guest blogger, Brian Wilhite, talks about using Windows PowerShell and WMI in the enterprise.<\/p>\n<p>Microsoft Scripting Guy, Ed Wilson, is here. Brian Wilhite is with us today to share a preview of his presentation for <a href=\"http:\/\/www.powershellsaturday.com\/002\" target=\"_blank\">Windows PowerShell Saturday<\/a>, whiche is coming to you in two weeks on September 15 in Charlotte. NC.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1805.wes-9-1-12-1.jpg\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/1805.wes-9-1-12-1.jpg\" alt=\"Photo of Brian Wilhite\" title=\"Photo of Brian Wilhite\" \/><\/a><\/p>\n<p>If you&rsquo;re like me and most system administrators, you are challenged daily to do more with less. Windows PowerShell, coupled with WMI, is one awesome duo, like Magic\/Kareem, Jordan\/Pippen, or Kobe\/Shaq&mdash;you get the idea. With this duo, you know that you&rsquo;ll be able to get the job done quickly, effectively, and efficiently. I use Windows PowerShell and WMI frequently, especially when my manager asks questions like, &ldquo;How many computers do we have in our environment that are running Windows&nbsp;2003 Server with Service Pack 1 or less?&rdquo; Obviously, Windows PowerShell and WMI are on the top of my list when addressing this very question in a timely manner.<\/p>\n<p>With the release of Windows&nbsp;8 and Windows Server&nbsp;2012, a few new players emerge that will change the way we interact with the CIM\/WMI model within Windows. If you&rsquo;re not familiar with these new &ldquo;players,&rdquo; you can quickly identify them with the following Windows PowerShell one-liner:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5224.wes-9-1-12-2.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/5224.wes-9-1-12-2.png\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p>As I briefly mentioned earlier, if someone needs information quickly, and you don&rsquo;t quite remember what WMI class has the particulars needed, <b>Get-CimClass<\/b> comes to the rescue. I know I&rsquo;m going to need server name, operating system, and service pack data elements, so what class has that information? I could run <b>Get-CimClass<\/b> and wade through all 1100 WMI classes to try to find what I need, or I could simply run the following Windows PowerShell command and pinpoint exactly what I&rsquo;m looking for.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4544.wes-9-1-12-3.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/4544.wes-9-1-12-3.png\" alt=\"Image of command output\" title=\"Image of command output\" \/><\/a><\/p>\n<p>The Win32_OperatingSystem WMI class looks like something I can use and it appears to have a property similar to &ldquo;Service Pack.&rdquo;<\/p>\n<p>I&rsquo;ve run out of time for now, but the good news is that there is more to come on September 15, when we will get deeper into detail with my &ldquo;Discovering the Power of WMI and PowerShell in the Enterprise&rdquo; session at the second Windows PowerShell Saturday.<\/p>\n<p>~Brian<\/p>\n<p>Thank you, Brian, for sharing this sneak peek.<\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\" target=\"_blank\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\" target=\"_blank\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\" target=\"_blank\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\" target=\"_blank\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p><b>Ed Wilson, Microsoft Scripting Guy<\/b>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Guest blogger, Brian Wilhite, talks about using Windows PowerShell and WMI in the enterprise. Microsoft Scripting Guy, Ed Wilson, is here. Brian Wilhite is with us today to share a preview of his presentation for Windows PowerShell Saturday, whiche is coming to you in two weeks on September 15 in Charlotte. NC. If you&rsquo;re [&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":[327,56,3,4,61,45,6],"class_list":["post-5044","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-brian-wilhite","tag-guest-blogger","tag-scripting-guy","tag-scripting-techniques","tag-weekend-scripter","tag-windows-powershell","tag-wmi"],"acf":[],"blog_post_summary":"<p>Summary: Guest blogger, Brian Wilhite, talks about using Windows PowerShell and WMI in the enterprise. Microsoft Scripting Guy, Ed Wilson, is here. Brian Wilhite is with us today to share a preview of his presentation for Windows PowerShell Saturday, whiche is coming to you in two weeks on September 15 in Charlotte. NC. If you&rsquo;re [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/5044","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=5044"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/5044\/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=5044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=5044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=5044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}