{"id":1511,"date":"2011-06-16T10:50:37","date_gmt":"2011-06-16T14:50:37","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/?p=1511"},"modified":"2011-06-16T10:50:37","modified_gmt":"2011-06-16T14:50:37","slug":"get-wmi-namespace","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/","title":{"rendered":"Get WMI Namespace"},"content":{"rendered":"<p>PowerShell and WMI just seem to go together like peanut butter and jelly, beer and pretzels, or salt and pepper. However, discovering things about WMI isn't always so easy. There are plenty of tools and scripts that will help you uncover WMI goodness, but here's another one anyway. Today's PowerShell function will get all namespaces on a computer.<!--more--><\/p>\n<p>The default namespace for Get-WMIObject is Root\\CimV2. But there are many other useful namespaces and classes that you can leverage in PowerShell. My function, Get-WMINamespace, will list either the top level namespaces or recursively search and return all namespaces.  Here's the main function code.<\/p>\n<p> [cc lang=\"PowerShell\"]<br \/>\nFunction Get-WMINamespace {<\/p>\n<p>[cmdletBinding()]<\/p>\n<p>Param(<br \/>\n    [Parameter(Position=0,Mandatory=$False,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]<br \/>\n    [ValidateNotNullorEmpty()]<br \/>\n    [Alias(\"name\")]<br \/>\n    [string]$Computername=$env:computername,<br \/>\n    [object]$Credential,<br \/>\n    [switch]$Recurse<br \/>\n)<\/p>\n<p>Begin {<br \/>\n    Write-Verbose -Message \"$(Get-Date) Starting $($myinvocation.mycommand)\"<br \/>\n    #convert credential to a PSCredential if a string was passed.<br \/>\n    if ( $Credential -is [system.management.automation.psCredential]) {<br \/>\n\t\tWrite-Verbose \"$(Get-Date) Using PSCredential for $($credential.username)\"<br \/>\n\t}<br \/>\n\tElseIf ($Credential) {<br \/>\n\t\tWrite-Verbose \"$(Get-Date) Getting PSCredential for $credential\"<br \/>\n\t\t$Credential=Get-Credential $credential<br \/>\n\t}<\/p>\n<p> } #close Begin<\/p>\n<p>Process {<\/p>\n<p>    #create a command string. PacketPrivacy is required for some namespaces<br \/>\n    #like MicrosoftTPM<br \/>\n    $cmd=\"Get-WMIObject -computername $computername -Namespace 'Root' -class '__Namespace' -authentication 'PacketPrivacy' -errorAction 'Stop'\"<\/p>\n<p>    if ($recurse) {<br \/>\n     $cmd+=\" -List -Recurse\"<br \/>\n    }<\/p>\n<p>    if ($Credential) {<br \/>\n     $cmd+=\" -credential `$Credential\"<br \/>\n    }  <\/p>\n<p>Try<br \/>\n{<br \/>\n    Write-Verbose -Message \"$(Get-Date) $cmd\"<br \/>\n    $data=Invoke-Expression $cmd<br \/>\n}<br \/>\nCatch<br \/>\n{<br \/>\n    Write-Warning \"Failed to retrieve namespace information from $Computername\"<br \/>\n    Write-Error $_<br \/>\n}<\/p>\n<p>if ($data)<br \/>\n{<br \/>\n  Write-Verbose \"$(Get-Date) Processing $(($data | measure-object).count) items\"<\/p>\n<p>  if ($Recurse) {<br \/>\n      #format the data to accomodate nested namespaces<br \/>\n      $data | Sort __NAMESPACE | Select @{Name=\"Computername\";Expression={$_.__SERVER}},<br \/>\n      @{Name=\"Namespace\";Expression={$_.__NAMESPACE}},<br \/>\n      @{Name=\"Name\";Expression={Split-Path $_.__Namespace -Leaf }}<br \/>\n  }<br \/>\n  else {<br \/>\n       $data | Sort __NAMESPACE | Select @{Name=\"Computername\";Expression={$_.__SERVER}},<br \/>\n      @{Name=\"Namespace\";Expression={Join-path -Path $_.__NAMESPACE -ChildPath $_.Name }},Name<br \/>\n  }<br \/>\n}<\/p>\n<p> } #close process<\/p>\n<p>End {<br \/>\n    Write-Verbose -Message \"$(Get-Date) Ending $($myinvocation.mycommand)\"<br \/>\n } #close End<\/p>\n<p>} #end Function<br \/>\n [\/cc]<\/p>\n<p>The function only needs a few parameters.  It defaults to the localhost but you can use -Computername to specify a different computer. For remote computers you can also specify either a saved PSCredential object or a user name to be used with Get-Credential.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n #convert credential to a PSCredential if a string was passed.<br \/>\n    if ( $Credential -is [system.management.automation.psCredential]) {<br \/>\n\t\tWrite-Verbose \"$(Get-Date) Using PSCredential for $($credential.username)\"<br \/>\n\t}<br \/>\n\tElseIf ($Credential) {<br \/>\n\t\tWrite-Verbose \"$(Get-Date) Getting PSCredential for $credential\"<br \/>\n\t\t$Credential=Get-Credential $credential<br \/>\n\t}<br \/>\n [\/cc]<\/p>\n<p>The function will only return top level namespaces, unless you use -Recurse. Because there are several ways to call Get-WMIObject based on my function parameters, I  dynamically build a command string. The function starts out with the core expression.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n#create a command string. PacketPrivacy is required for some namespaces<br \/>\n#like MicrosoftTPM<br \/>\n$cmd=\"Get-WMIObject -computername $computername -Namespace 'Root' -class '__Namespace' -authentication 'PacketPrivacy' -errorAction 'Stop'\"<br \/>\n[\/cc]<\/p>\n<p>If I'm recursing, then I append the necessary parameters.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nif ($recurse) {<br \/>\n     $cmd+=\" -List -Recurse\"<br \/>\n    }<br \/>\n[\/cc]<\/p>\n<p>Finally, if a credential is passed, that too is added to the command string.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\n  if ($Credential) {<br \/>\n     $cmd+=\" -credential `$Credential\"<br \/>\n    }<br \/>\n[\/cc]<\/p>\n<p>The tricky part that eluded me for a bit was to escape the $ in $Credential so that the final command string would include the right variable name. Once the command string is complete, I run it with Invoke-Expression.<\/p>\n<p>[cc lang=\"PowerShell\"]<br \/>\nTry<br \/>\n{<br \/>\n    Write-Verbose -Message \"$(Get-Date) $cmd\"<br \/>\n    $data=Invoke-Expression $cmd<br \/>\n}<br \/>\n[\/cc]<\/p>\n<p>Assuming data is returned, all that's left is to format the data. I need to make adjustments depending on whether the function searched recursively or not. Notice my use of the Path cmdlets to split or join the Namespace path.<\/p>\n<p>[cc lang=\"Powershell\"]<br \/>\nif ($Recurse) {<br \/>\n      #format the data to accomodate nested namespaces<br \/>\n      $data | Sort __NAMESPACE | Select @{Name=\"Computername\";Expression={$_.__SERVER}},<br \/>\n      @{Name=\"Namespace\";Expression={$_.__NAMESPACE}},<br \/>\n      @{Name=\"Name\";Expression={Split-Path $_.__Namespace -Leaf }}<br \/>\n  }<br \/>\n  else {<br \/>\n       $data | Sort __NAMESPACE | Select @{Name=\"Computername\";Expression={$_.__SERVER}},<br \/>\n      @{Name=\"Namespace\";Expression={Join-path -Path $_.__NAMESPACE -ChildPath $_.Name }},Name<br \/>\n  }<br \/>\n[\/cc]<\/p>\n<p>Once the function is loaded into your session you can run it like this.<\/p>\n<p>[cc lang=\"DOS\"]<\/p>\n<p>PS C:\\> Get-WMINamespace<\/p>\n<p>Computername                   Namespace                               Name<br \/>\n------------                   ---------                               ----<br \/>\nSERENITY                       ROOT\\Policy                             Policy<br \/>\nSERENITY                       ROOT\\Interop                            Interop<br \/>\nSERENITY                       ROOT\\WMI                                WMI<br \/>\nSERENITY                       ROOT\\directory                          directory<br \/>\nSERENITY                       ROOT\\Microsoft                          Microsoft<br \/>\nSERENITY                       ROOT\\aspnet                             aspnet<br \/>\nSERENITY                       ROOT\\ServiceModel                       ServiceModel<br \/>\nSERENITY                       ROOT\\SecurityCenter                     SecurityCenter<br \/>\nSERENITY                       ROOT\\RSOP                               RSOP<br \/>\nSERENITY                       ROOT\\CIMV2                              CIMV2<br \/>\nSERENITY                       ROOT\\Cli                                Cli<br \/>\nSERENITY                       ROOT\\subscription                       subscription<br \/>\nSERENITY                       ROOT\\DEFAULT                            DEFAULT<br \/>\nSERENITY                       ROOT\\snmp                               snmp<br \/>\nSERENITY                       ROOT\\SecurityCenter2                    SecurityCenter2<br \/>\nSERENITY                       ROOT\\nap                                nap<br \/>\nSERENITY                       ROOT\\SECURITY                           SECURITY<\/p>\n<p>PS C:\\> Get-WMINamespace -computername \"JDHIT-DC01\" -cred $jdhit -recurse | Select Namespace<\/p>\n<p>Namespace<br \/>\n---------<br \/>\nROOT<br \/>\nROOT\\aspnet<br \/>\nROOT\\CIMV2<br \/>\nROOT\\CIMV2\\Applications<br \/>\nROOT\\CIMV2\\Applications\\MicrosoftIE<br \/>\nROOT\\Cli<br \/>\nROOT\\DEFAULT<br \/>\nROOT\\directory<br \/>\nROOT\\directory\\LDAP<br \/>\nROOT\\Microsoft<br \/>\nROOT\\Microsoft\\HomeNet<br \/>\nROOT\\MicrosoftActiveDirectory<br \/>\nROOT\\MicrosoftDNS<br \/>\nROOT\\MicrosoftIISv2<br \/>\nROOT\\MicrosoftNLB<br \/>\nROOT\\MSCluster<br \/>\nROOT\\perfmon<br \/>\nROOT\\Policy<br \/>\nROOT\\RSOP<br \/>\nROOT\\RSOP\\Computer<br \/>\nROOT\\RSOP\\User<br \/>\nROOT\\RSOP\\User\\S_1_5_21_805063240_3875113082_2769008284_500<br \/>\nROOT\\SECURITY<br \/>\nROOT\\ServiceModel<br \/>\nROOT\\snmp<br \/>\nROOT\\snmp\\localhost<br \/>\nROOT\\subscription<br \/>\nROOT\\WMI<br \/>\n[\/cc]<\/p>\n<p>Enjoy!! <\/p>\n<p>Download <a href='http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2011\/06\/Get-WMINamespace-v2.txt' target=\"_blank\">Get-WMINamespace-v2<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell and WMI just seem to go together like peanut butter and jelly, beer and pretzels, or salt and pepper. However, discovering things about WMI isn&#8217;t always so easy. There are plenty of tools and scripts that will help you uncover WMI goodness, but here&#8217;s another one anyway. Today&#8217;s PowerShell function will get all namespaces&#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":[32,103,298,534,105,547],"class_list":["post-1511","post","type-post","status-publish","format-standard","hentry","category-wmi","tag-functions","tag-get-wmiobject","tag-invoke-expression","tag-powershell","tag-pscredential","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 WMI Namespace &#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\/1511\/get-wmi-namespace\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get WMI Namespace &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"PowerShell and WMI just seem to go together like peanut butter and jelly, beer and pretzels, or salt and pepper. However, discovering things about WMI isn&#039;t always so easy. There are plenty of tools and scripts that will help you uncover WMI goodness, but here&#039;s another one anyway. Today&#039;s PowerShell function will get all namespaces...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2011-06-16T14:50:37+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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Get WMI Namespace\",\"datePublished\":\"2011-06-16T14:50:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/\"},\"wordCount\":807,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"keywords\":[\"functions\",\"Get-WMIObject\",\"Invoke-Expression\",\"PowerShell\",\"PSCredential\",\"WMI\"],\"articleSection\":[\"WMI\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/\",\"name\":\"Get WMI Namespace &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2011-06-16T14:50:37+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wmi\\\/1511\\\/get-wmi-namespace\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"WMI\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/wmi\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get WMI Namespace\"}]},{\"@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 WMI Namespace &#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\/1511\/get-wmi-namespace\/","og_locale":"en_US","og_type":"article","og_title":"Get WMI Namespace &#8226; The Lonely Administrator","og_description":"PowerShell and WMI just seem to go together like peanut butter and jelly, beer and pretzels, or salt and pepper. However, discovering things about WMI isn't always so easy. There are plenty of tools and scripts that will help you uncover WMI goodness, but here's another one anyway. Today's PowerShell function will get all namespaces...","og_url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/","og_site_name":"The Lonely Administrator","article_published_time":"2011-06-16T14:50:37+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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Get WMI Namespace","datePublished":"2011-06-16T14:50:37+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/"},"wordCount":807,"commentCount":0,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"keywords":["functions","Get-WMIObject","Invoke-Expression","PowerShell","PSCredential","WMI"],"articleSection":["WMI"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/","url":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/","name":"Get WMI Namespace &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"datePublished":"2011-06-16T14:50:37+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/wmi\/1511\/get-wmi-namespace\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"WMI","item":"https:\/\/jdhitsolutions.com\/blog\/category\/wmi\/"},{"@type":"ListItem","position":2,"name":"Get WMI Namespace"}]},{"@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":5577,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/5577\/friday-fun-listing-wmi-namespaces\/","url_meta":{"origin":1511,"position":0},"title":"Friday Fun: Listing WMI Namespaces","author":"Jeffery Hicks","date":"May 5, 2017","format":false,"excerpt":"Welcome once again to the end of the week.\u00a0 Hopefully you spent some time in PowerShell. If not, perhaps this tidbit will be intriguing enough to give it a try. I always try to put the \"fun\" in function and today I have one that will enumerate all the WMI\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"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":6082,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6082\/searching-for-a-cim-wmi-class-with-powershell\/","url_meta":{"origin":1511,"position":1},"title":"Searching for a CIM\/WMI Class with PowerShell","author":"Jeffery Hicks","date":"September 18, 2018","format":false,"excerpt":"I got a question on Twitter about an older function I has posted to get antivirus information via WMI. The function continues to work fine with Windows 10, although there's always room for improvement. However, the question was that the function did not seem to work when querying a server\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/image_thumb.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/image_thumb.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/image_thumb.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2018\/09\/image_thumb.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":8541,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/8541\/getting-ciminstance-by-path\/","url_meta":{"origin":1511,"position":2},"title":"Getting CIMInstance by Path","author":"Jeffery Hicks","date":"August 20, 2021","format":false,"excerpt":"I am a member of the PowerShell Cmdlet Working Group. We've been looking into this issue and it is an intriguing one. Enough so that I spent some time looking into it and writing up some test code. If you work with WMI\/CIM this might be of interest to you.\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/add-ciminstancepath2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/add-ciminstancepath2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/add-ciminstancepath2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2021\/08\/add-ciminstancepath2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":654,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/654\/new-wmi-object\/","url_meta":{"origin":1511,"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":43,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/43\/more-free-scripting-tools\/","url_meta":{"origin":1511,"position":4},"title":"More free scripting tools","author":"Jeffery Hicks","date":"August 16, 2006","format":false,"excerpt":"SAPIEN Technologies has released some free tools for scripters at http:\/\/www.primalscript.com\/freetools\/. One of them is the PowerShell help viewer I discussed a few posts back. This is great when you're in PowerShell and can't remember a cmdlet's syntax.They also have a nifty WMI explorer. This tool lets you browse all\u2026","rel":"","context":"In &quot;Scripting&quot;","block_context":{"text":"Scripting","link":"https:\/\/jdhitsolutions.com\/blog\/category\/scripting\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":636,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/636\/select-wmi\/","url_meta":{"origin":1511,"position":5},"title":"Select WMI","author":"Jeffery Hicks","date":"May 13, 2010","format":false,"excerpt":"I\u2019ve been helping out on some WMI and PowerShell issues in the forums at ScriptingAnswers.com. As I was working on a problem I ended up taking a slight detour to address an issue that has always bugged me. When I run a command like this: get-wmiobject -query \"Select Name,Description,Disabled from\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":"selectwmi","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/05\/selectwmi-300x89.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1511","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=1511"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1511\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}