{"id":2338,"date":"2012-05-23T10:09:54","date_gmt":"2012-05-23T14:09:54","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=2338"},"modified":"2012-05-23T10:09:54","modified_gmt":"2012-05-23T14:09:54","slug":"query-local-administrators-with-wmi","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/","title":{"rendered":"Query Local Administrators with WMI"},"content":{"rendered":"<p>I have a quick post today on using WMI to list members of the local administrators group. It is very simple to get the group itself with the Win32_Group class.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS S:\\> get-wmiobject win32_group -filter \"name='Administrators'\"<\/p>\n<p>Caption             Domain              Name                SID<br \/>\n-------             ------              ----                ---<br \/>\nSERENITY\\Adminis... SERENITY            Administrators      S-1-5-32-544<br \/>\n<\/code><\/p>\n<p>But the class doesn't have any methods or properties for returning members. However, WMI does allow for this cool thing called \"Associators Of\". Basically we ask WMI, \"Find everything associated or related to this object\". One quick way to do this is with the GetRelated() method.<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS S:\\> $group=get-wmiobject win32_group -filter \"name='Administrators'\"<br \/>\nPS S:\\> $group.GetRelated()<br \/>\n<\/code><\/p>\n<p>By default this will probably return more information than what you need. However, if you know you want to limit results to a single class you can do something like this:<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS S:\\> $group=get-wmiobject win32_group -filter \"name='Administrators'\"<br \/>\nPS S:\\> $group.GetRelated(\"win32_useraccount\")<\/p>\n<p>AccountType : 512<br \/>\nCaption     : SERENITY\\Administrator<br \/>\nDomain      : SERENITY<br \/>\nSID         : S-1-5-21-2858895768-3673612314-3109562570-500<br \/>\nFullName    :<br \/>\nName        : Administrator<\/p>\n<p>AccountType : 512<br \/>\nCaption     : SERENITY\\Jeff<br \/>\nDomain      : SERENITY<br \/>\nSID         : S-1-5-21-2858895768-3673612314-3109562570-1000<br \/>\nFullName    :<br \/>\nName        : Jeff<\/p>\n<p>AccountType : 512<br \/>\nCaption     : SERENITY\\Backup<br \/>\nDomain      : SERENITY<br \/>\nSID         : S-1-5-21-2858895768-3673612314-3109562570-1010<br \/>\nFullName    :<br \/>\nName        : Backup<br \/>\n<\/code><\/p>\n<p>That's pretty easy and fast. Unfortunately in this scenario, the group might also have other groups as a member which is a different class and I couldn't find a reasonable syntax with GetRelated() to handle multiple classes. So instead we'll go back to native WMI approach and use an Associators Of query. <\/p>\n<p>This type of query must be follow a specific format. The best way is to use WBEMTest to find your object, then click on the Assopciators button. Your query syntax will be in the top of the query dialog box. This default query will return everything, but you can add additional filtering. Check out <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa384793(v=vs.85).aspx\" target=\"_blank\">http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/aa384793(v=vs.85).aspx<\/a> to learn more. In this situation, this query will return both users and groups.<\/p>\n<p><code lang=\"PowerShell\"><br \/>\n$query=\"Associators of {Win32_Group.Domain='$computer',Name='Administrators'} where Role=GroupComponent\"<br \/>\n<\/code><\/p>\n<p>Here's one way I might use it:<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS S:\\> get-wmiobject -query $query -ComputerName $computer | Select Name,Caption,__CLASS<\/p>\n<p>Name                       Caption                    __CLASS<br \/>\n----                       -------                    -------<br \/>\nAdministrator              SERENITY\\Administrator     Win32_UserAccount<br \/>\nJeff                       SERENITY\\Jeff              Win32_UserAccount<br \/>\nBackup                     SERENITY\\Backup            Win32_UserAccount<br \/>\nHelp Desk                  SERENITY\\Help Desk         Win32_Group<br \/>\n<\/code><\/p>\n<p>I might even refine it a bit:<\/p>\n<p><code lang=\"DOS\"><br \/>\nPS S:\\> get-wmiobject -query $query -computer $computer |<br \/>\n>> Select @{Name=\"Members\";Expression={$_.Caption}},<br \/>\n>> @{Name=\"Type\";Expression={([regex]\"User|Group\").matches($_.__CLASS)[0].Value}},<br \/>\n>> @{Name=\"Computername\";Expression={$_.__SERVER}}<br \/>\n>><\/p>\n<p>Members                    Type                       Computername<br \/>\n-------                    ----                       ------------<br \/>\nSERENITY\\Administrator     User                       SERENITY<br \/>\nSERENITY\\Jeff              User                       SERENITY<br \/>\nSERENITY\\Backup            User                       SERENITY<br \/>\nSERENITY\\Help Desk         Group                      SERENITY<br \/>\n<\/code><\/p>\n<p>It doesn't take much more effort to turn this into a function, but I'll leave that fun to you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a quick post today on using WMI to list members of the local administrators group. It is very simple to get the group itself with the Win32_Group class. PS S:\\> get-wmiobject win32_group -filter &#8220;name=&#8217;Administrators'&#8221; Caption Domain Name SID &#8212;&#8212;- &#8212;&#8212; &#8212;- &#8212; SERENITY\\Adminis&#8230; SERENITY Administrators S-1-5-32-544 But the class doesn&#8217;t have any methods&#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":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[19],"tags":[300,534,540,547],"class_list":["post-2338","post","type-post","status-publish","format-standard","hentry","category-wmi","tag-administrators","tag-powershell","tag-scripting","tag-wmi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Query Local Administrators 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\/wmi\/2338\/query-local-administrators-with-wmi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Query Local Administrators with WMI &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I have a quick post today on using WMI to list members of the local administrators group. It is very simple to get the group itself with the Win32_Group class. PS S:&gt; get-wmiobject win32_group -filter &quot;name=&#039;Administrators&#039;&quot; Caption Domain Name SID ------- ------ ---- --- SERENITYAdminis... SERENITY Administrators S-1-5-32-544 But the class doesn&#039;t have any methods...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-23T14:09:54+00:00\" \/>\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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Query Local Administrators with WMI\",\"datePublished\":\"2012-05-23T14:09:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/\"},\"wordCount\":285,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"Administrators\",\"PowerShell\",\"Scripting\",\"WMI\"],\"articleSection\":[\"WMI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/\",\"name\":\"Query Local Administrators with WMI &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2012-05-23T14:09:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/2338\\\/query-local-administrators-with-wmi\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"WMI\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/wmi\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Query Local Administrators 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":"Query Local Administrators 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\/wmi\/2338\/query-local-administrators-with-wmi\/","og_locale":"en_US","og_type":"article","og_title":"Query Local Administrators with WMI &#8226; The Lonely Administrator","og_description":"I have a quick post today on using WMI to list members of the local administrators group. It is very simple to get the group itself with the Win32_Group class. PS S:> get-wmiobject win32_group -filter \"name='Administrators'\" Caption Domain Name SID ------- ------ ---- --- SERENITYAdminis... SERENITY Administrators S-1-5-32-544 But the class doesn't have any methods...","og_url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/","og_site_name":"The Lonely Administrator","article_published_time":"2012-05-23T14:09:54+00:00","author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Query Local Administrators with WMI","datePublished":"2012-05-23T14:09:54+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/"},"wordCount":285,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["Administrators","PowerShell","Scripting","WMI"],"articleSection":["WMI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/","url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/","name":"Query Local Administrators with WMI &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2012-05-23T14:09:54+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/2338\/query-local-administrators-with-wmi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"WMI","item":"https:\/\/jdhitsolutions.com\/blog\/category\/wmi\/"},{"@type":"ListItem","position":2,"name":"Query Local Administrators 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":1532,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/1532\/get-local-administrators-with-wmi-and-powershell\/","url_meta":{"origin":2338,"position":0},"title":"Get Local Administrators with WMI and PowerShell","author":"Jeffery Hicks","date":"July 1, 2011","format":false,"excerpt":"Earlier this week I was helping someone out on a problem working with the local administrators group. There are a variety of ways to enumerate the members of a local group. The code he was using involved WMI. I hadn't really worked with the WMI approach in any great detail\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":2342,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2342\/query-local-administrators-with-cim\/","url_meta":{"origin":2338,"position":1},"title":"Query Local Administrators with CIM","author":"Jeffery Hicks","date":"May 24, 2012","format":false,"excerpt":"Yesterday I posted an article on listing members of the local administrators group with PowerShell and Get-WmiObject. PowerShell 3.0 offers an additional way using the CIM cmdlets. The CIM cmdlets query the same WMI information, except instead of using the traditional RPC\/DCOM connection, these cmdlets utilize PowerShell's remoting endpoint so\u2026","rel":"","context":"In &quot;Powershell 3.0&quot;","block_context":{"text":"Powershell 3.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-3-0\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/05\/talkbubble-v3-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2760,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/2760\/find-files-with-wmi-and-powershell\/","url_meta":{"origin":2338,"position":2},"title":"Find Files with WMI and PowerShell","author":"Jeffery Hicks","date":"January 29, 2013","format":false,"excerpt":"Finding files is one of those necessary evils for IT Pros. Sometimes we're searching for a needle in a haystack. And it gets even more complicated when the haystacks are on 10 or 100 or 1000 remote computers. You might think using Get-ChildItem is your only option. Certainly it works,\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"magnifying-glass-text-label-search","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/01\/magnifying-glass-text-label-search-150x150.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":654,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/","url_meta":{"origin":2338,"position":3},"title":"New WMI Object","author":"Jeffery Hicks","date":"May 17, 2010","format":false,"excerpt":"I have one more variation on my recent theme of working with WMI objects. I wanted to come up with something flexible and re-usable where you could specify a WMI class and some properties and get a custom object with all the classes combined. My solution is a function called\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2241,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/2241\/skipping-wmi-system-properties-in-powershell\/","url_meta":{"origin":2338,"position":4},"title":"Skipping WMI System Properties in PowerShell","author":"Jeffery Hicks","date":"April 25, 2012","format":false,"excerpt":"One of my favorite techniques when using WMI in PowerShell is to pipe an object to Select-Object and select all properties. Try this: get-wmiobject win32_bios | select * It works, but it also gets all of the system properties like __PATH which I rarely care about. I also get other\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1551,"url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1551\/find-non-system-service-accounts-with-powershell-and-wmi\/","url_meta":{"origin":2338,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2338","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=2338"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2338\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}