{"id":3555,"date":"2013-11-13T15:13:00","date_gmt":"2013-11-13T20:13:00","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=3555"},"modified":"2013-11-14T07:26:33","modified_gmt":"2013-11-14T12:26:33","slug":"get-powershell-version-with-wmi","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/","title":{"rendered":"Get PowerShell Version with WMI"},"content":{"rendered":"<p>With the release of PowerShell 4.0, it is possible you might end up with a mix of systems in your environment. I know I do because I do a lot of writing, testing and development that requires multiple versions in my test network. Recently I was doing some Group Policy work when I thought about WMI filters. A WMI filter is a way to limit Group Policy to machines that meet certain criteria. I thought it would be useful to have a WMI filter that could determine if the computer was running PowerShell 3 or 4. Why? Well one reason would be so that v4 machines would update help from a local v4 source and likewise for v3. So I started looking a developing a WMI query.<\/p>\n<p>That led to the development of this:<\/p>\n<pre class=\"lang:ps decode:true\">\r\nFunction Get-WMIPowerShell {\r\n\r\n[cmdletbinding()]\r\nParam(\r\n[Parameter(Position=0,ValueFromPipeline=$True)]\r\n[alias(\"cn\",\"pscomputername\")]\r\n[string[]]$Computername = $env:COMPUTERNAME\r\n)\r\n\r\nBegin {\r\n    Write-Verbose -Message \"Starting $($MyInvocation.Mycommand)\"  \r\n\r\n    $wmiParam=@{\r\n     class = 'CIM_datafile'\r\n     filter= \"\"name='c:\\\\windows\\\\system32\\\\windowspowershell\\\\v1.0\\\\powershell.exe'\"\r\n     ComputerName= $Null\r\n     ErrorAction= \"Stop\"\r\n    }\r\n} #begin\r\n\r\nProcess {\r\n\r\nforeach ($computer in $computername) {\r\n     Write-Verbose \"Querying $computer.toUpper())\"\r\n     $wmiParam.Computername=$Computer\r\n    Try {\r\n     Get-WMIObject @wmiParam | Select @{name=\"Computername\";Expression={$_.CSName}},\r\n     Name,Version,FileSize,\r\n     @{Name=\"Installed\";Expression={$_.ConvertToDateTime($_.InstallDate)}}\r\n    }\r\n    Catch {\r\n      Write-Warning \"Failed to retrieve WMI information from $computername\"\r\n      Write-Warning $_.Exception.Message\r\n    }\r\n } #foreach\r\n} #process\r\n\r\nEnd {\r\n    Write-Verbose -Message \"Ending $($MyInvocation.Mycommand)\"\r\n} #end\r\n\r\n} #end function<\/pre>\n<p>This function uses WMI to retrieve the instance of the CIM_DATAFILE class for PowerShell.exe. I have found when querying for this class to be as specific in your query as you can. This runs pretty quickly and returns some useful information. I can even run it for a group of computers.<\/p>\n<pre class=\"lang:batch decode:true\">PS S:\\&gt; Get-WMIPowerShell -comp chi-dc01,chi-dc02,chi-dc04,chi-hvr2.globomantics.local,jdhit-dc01,novo8 | out-gridview -title \"PS Version\"<\/pre>\n<p>Which gives me this:<br \/>\n<a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3556\" alt=\"get-wmipshell\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell-1024x244.png\" width=\"625\" height=\"148\" srcset=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell-1024x244.png 1024w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell-300x71.png 300w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell-624x149.png 624w, https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell.png 1260w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><\/p>\n<p>The first two machines are running PowerShell 2.0, the next 2 v3 and the last 2 v4. Now that I know this works, I can create a WMI filter with a query like this:<\/p>\n<pre class=\"lang:batch decode:true \" >\"Select * from CIM_Datafile where name='c:\\\\windows\\\\system32\\\\windowspowershell\\\\v1.0\\\\powershell.exe' AND version like '6.2%'\"<\/pre>\n<p>This should filter only for computers running PowerShell 3.0.<\/p>\n<p>I wrote this function thinking I would add support for alternate credentials. But if you don't need it, you can also get the same information using the [WMI] type accelerator.<\/p>\n<pre class=\"lang:batch decode:true \" >PS S:\\&gt; [WMI]\"\\\\CHI-DC04\\root\\cimv2:CIM_DataFile.Name='c:\\\\windows\\\\system32\\\\windowspowershell\\\\v1.0\\\\powershell.exe'\"\r\n\r\n\r\nCompressed : False\r\nEncrypted  : False\r\nSize       : \r\nHidden     : False\r\nName       : c:\\\\windows\\\\system32\\\\windowspowershell\\\\v1.0\\\\powershell.exe\r\nReadable   : True\r\nSystem     : False\r\nVersion    : 6.2.9200.16384\r\nWriteable  : True<\/pre>\n<p>I needed to test and develop a SELECT query which is why I ended up with the function I did. The date information is extra and if you use Get-CIMInstance, the dates are converted for you.<\/p>\n<pre class=\"lang:ps decode:true \" >\r\n$wmiParam=@{\r\n     class = 'CIM_datafile'\r\n     filter= \"name='c:\\\\windows\\\\system32\\\\windowspowershell\\\\v1.0\\\\powershell.exe' AND version like '6.2%'\"\r\n     ComputerName= 'CHI-DC04'\r\n     ErrorAction= \"Stop\"\r\n    }\r\n\r\nGet-CIMInstance @wmiParam | Select PSComputername,Name,Version,FileSize,InstallDate<\/pre>\n<p>Yes, I know you can get this information with Test-WSMan as well and that is certainly a much easier way. Although if by chance you still have PowerShell 1.0 in use, I don't think that will work. Anyway, there you have it. A quick way using WMI to find out the PowerShell version and a query you can use to build a WMI filter for Group Policy. <\/p>\n<p>Enjoy.<\/p>\n<p>UPDATE 11\/14<br \/>\nI don't know what I was thinking with my original query. It was much more complicated than it needed to be. I've updated my code samples with a better filter. Remember when using \\ in any paths, it needs to be escaped which is why you see the name as you do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the release of PowerShell 4.0, it is possible you might end up with a mix of systems in your environment. I know I do because I do a lot of writing, testing and development that requires multiple versions in my test network. Recently I was doing some Group Policy work when I thought about&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"New from the blog: Get #PowerShell Version with WMI","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[287,4,19],"tags":[387,570,534,547],"class_list":["post-3555","post","type-post","status-publish","format-standard","hentry","category-group-policy","category-powershell","category-wmi","tag-cim","tag-group-policy","tag-powershell","tag-wmi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Get PowerShell Version with WMI &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get PowerShell Version with WMI &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"With the release of PowerShell 4.0, it is possible you might end up with a mix of systems in your environment. I know I do because I do a lot of writing, testing and development that requires multiple versions in my test network. Recently I was doing some Group Policy work when I thought about...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2013-11-13T20:13:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-11-14T12:26:33+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell-1024x244.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Get PowerShell Version with WMI\",\"datePublished\":\"2013-11-13T20:13:00+00:00\",\"dateModified\":\"2013-11-14T12:26:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/\"},\"wordCount\":421,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/11\\\/get-wmipshell-1024x244.png\",\"keywords\":[\"CIM\",\"Group Policy\",\"PowerShell\",\"WMI\"],\"articleSection\":[\"Group Policy\",\"PowerShell\",\"WMI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/\",\"name\":\"Get PowerShell Version with WMI &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/11\\\/get-wmipshell-1024x244.png\",\"datePublished\":\"2013-11-13T20:13:00+00:00\",\"dateModified\":\"2013-11-14T12:26:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/11\\\/get-wmipshell.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/11\\\/get-wmipshell.png\",\"width\":1260,\"height\":301},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/3555\\\/get-powershell-version-with-wmi\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Group Policy\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/group-policy\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get PowerShell Version with WMI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get PowerShell Version with WMI &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/","og_locale":"en_US","og_type":"article","og_title":"Get PowerShell Version with WMI &#8226; The Lonely Administrator","og_description":"With the release of PowerShell 4.0, it is possible you might end up with a mix of systems in your environment. I know I do because I do a lot of writing, testing and development that requires multiple versions in my test network. Recently I was doing some Group Policy work when I thought about...","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/","og_site_name":"The Lonely Administrator","article_published_time":"2013-11-13T20:13:00+00:00","article_modified_time":"2013-11-14T12:26:33+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell-1024x244.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Get PowerShell Version with WMI","datePublished":"2013-11-13T20:13:00+00:00","dateModified":"2013-11-14T12:26:33+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/"},"wordCount":421,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell-1024x244.png","keywords":["CIM","Group Policy","PowerShell","WMI"],"articleSection":["Group Policy","PowerShell","WMI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/","name":"Get PowerShell Version with WMI &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell-1024x244.png","datePublished":"2013-11-13T20:13:00+00:00","dateModified":"2013-11-14T12:26:33+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/11\/get-wmipshell.png","width":1260,"height":301},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3555\/get-powershell-version-with-wmi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Group Policy","item":"https:\/\/jdhitsolutions.com\/blog\/category\/group-policy\/"},{"@type":"ListItem","position":2,"name":"Get PowerShell Version with WMI"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1551,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1551\/find-non-system-service-accounts-with-powershell-and-wmi\/","url_meta":{"origin":3555,"position":0},"title":"Find Non System Service Accounts with PowerShell and WMI","author":"Jeffery Hicks","date":"July 5, 2011","format":false,"excerpt":"As easy as Get-Service is to use in PowerShell, it has one limitation for IT Pros: it can't show you what account the service is running under. In old school terms, \"What is the service account?\" Fortunately you can get that information using WMI. Here's a query you can use\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1687,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1687\/filter-left\/","url_meta":{"origin":3555,"position":1},"title":"Filter Left","author":"Jeffery Hicks","date":"October 14, 2011","format":false,"excerpt":"When writing WMI queries expressions in Windows PowerShell, it is recommended to use WMI filtering, as opposed to getting objects and then filtering with Where-Object. I see expressions like this quite often: [cc lang=\"PowerShell\"] get-wmiobject win32_process -computer $c | where {$_.name -eq \"notepad.exe\"} [\/cc] In this situation, ALL process objects\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/10\/talkbubble.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2848,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2848\/wmi-explorer-from-the-powershell-guy\/","url_meta":{"origin":3555,"position":2},"title":"WMI Explorer from The PowerShell Guy","author":"Jeffery Hicks","date":"March 8, 2013","format":false,"excerpt":"Several years ago, The PowerShell Guy, aka MoW, wrote a fantastic graphical PowerShell script that was a WMI Explorer. With this script you could connect to a computer and namespace, browse classes and view instances. A great way for discovering things about WMI. However Marc has moved on to other\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"wmibrowser","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/03\/wmibrowser-1024x552.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/03\/wmibrowser-1024x552.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/03\/wmibrowser-1024x552.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1806,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/1806\/wmi-powershell-tricks-for-windows-server\/","url_meta":{"origin":3555,"position":3},"title":"WMI PowerShell Tricks for Windows Server&#8230;","author":"Jeffery Hicks","date":"November 15, 2011","format":false,"excerpt":"WMI PowerShell Tricks for Windows Server Management*My first article for @petri_co_il on WMI PowerShell Tricks http:\/\/bit.ly\/rx1YrD Get-WMIObject - PowerShell Tricks Windows Server Management Get-WMIObject in Windows Powershell makes it easier to utilize Windows Management Instrumentation (WMI) and makes managing windows servers much easier.","rel":"","context":"In &quot;Google Plus&quot;","block_context":{"text":"Google Plus","link":"https:\/\/jdhitsolutions.com\/blog\/category\/google-plus\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3497,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3497\/resolving-sids-with-wmi-wsman-and-powershell\/","url_meta":{"origin":3555,"position":4},"title":"Resolving SIDs with WMI, WSMAN and PowerShell","author":"Jeffery Hicks","date":"October 15, 2013","format":false,"excerpt":"In the world of Windows, an account SID can be a very enigmatic thing. Who is S-1-5-21-2250542124-3280448597-2353175939-1019? Fortunately, many applications, such as the event log viewer resolve the SID to an account name. The downside, is that when you are accessing that same type of information from PowerShell, you end\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"win32_sid-fail","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/10\/win32_sid-fail-1024x330.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/10\/win32_sid-fail-1024x330.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/10\/win32_sid-fail-1024x330.png?resize=525%2C300 1.5x"},"classes":[]},{"id":2773,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2773\/find-files-with-wmi-and-powershell-revisited\/","url_meta":{"origin":3555,"position":5},"title":"Find Files with WMI and PowerShell Revisited","author":"Jeffery Hicks","date":"February 4, 2013","format":false,"excerpt":"Last week I posted a PowerShell function to find files using WMI. One of the comments I got was about finding files with wildcards. In WMI, we've been able to search via wildcards and the LIKE operator since the days of XP. In a WMI query we use the %\u2026","rel":"","context":"In &quot;WMI&quot;","block_context":{"text":"WMI","link":"https:\/\/jdhitsolutions.com\/blog\/category\/wmi\/"},"img":{"alt_text":"computereye","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/04\/computereye-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3555","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=3555"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/3555\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=3555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=3555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=3555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}