How to manage WMI namespace powershell?[WMI Week – Day 2]2023-06-18T13:07:57+00:00
  • wmi namespace powershell

This is the 1th post of a series of 6 articles entitled “WMI Week“. It tends to covers the automation tasks around WMI mainly using the powershell WMI module. Check out the introduction of the WMI week here.The first gives a short introduction concerning WMI, and show what tools are usefull when working with WMI. The second post (This one) covers how to manage WMI namespaces using windows powershell. The third post highlights how we can, create, retrieve delete, and manage WMI classes.  The fourth post  covers everything you need to know about WMI properties. The fifth post  will highlight everything related to WMI qualifiers, and the last and six’th post will explain everything you need the know about WMI Instances.[important]By the way,the powershell WMI module is available here ( and Don’t forget to rate it  by clicking on the stars ;)).[/important]

Today is a nice and sunny day. This type of weather sometimes makes me want to go out and work outside, in front of the Rhine here in Basel / Switzerland.But unfortunatley even though I recently set up EMS via Configuration manager 2012 with intune integration, which would allow me to take my Android Samsung Galaxy tab 3 tablet and work sitting in front of the river, It is a bit chilly outside, and working there for more then 30min will probably have a direct bad influence on my health. Talking about Configuration manager 2012, the CU3 just got published. If you haven’t downloaded it yet, you can get it here.

Today is also the day that I passed the 70-243:Configuration Manager : Administering and deploying certification exam. So the CU3, the weather, and the exam are perfect ingredients for a great soup that we could name “very good day” 🙂By the way,I got a bit warmer, and I decided to go to the river for lunch today. Find here a picture I took of the Rhine, which is just around the corner 🙂 Enjoy!

Basel center (1min from work ;))

In  today’s post, I will explain how we can leverage PowerShell in order to create custom namespaces in our WMI repository. To make things easy, this will be done with the WMI powershell module. Here is the agenda:

  • How to find WMI cmdlets information.
  • How to get WMI namespace information.
  • How to create a WMI namespace.

How to find commands to manage WMI namespace with powershell:

First thing first, let’s load the module and see what cmdlets are available for us to use :

The following screenshots shows what has been returned.wmi namespace powershell

  • Get-WMINameSpace
  • New-WMINameSpace

Now, which one of these two commands would you use in order to create a new wmi namespace.. ? 😉Obviously, you will not use get-wminamespace to create something (will ya ? 0_o)

How to find WMI namespace PowerShell? 

In order to find what WMI namespaces we have on our system will use Get-WMINameSpace.Let’s use Get-WMINamespace and discover what WMI namespaces are present on my machine.We want to create a WMI namespace called “District” in the root of our WMI repository (yes, the root, not the RootCimv29.The following screenshots show the current WMI nameSpaces that are present in the root ot the WMI repository of my machine.

get-wminamespace[notice]The results that are returned can vary depending on the different installation that has been done (Bitlocker, custom wmi namespaces, specefic programs etc…[/notice]

How to create custom wmi namespaces Powershell?

Now that we know what namespaces are present, let’s go and try to create a wmi namespace using the “New-WMINamespace” cmdlet.[important] The PowerShell console must run in elevated mode in order to be able to create a WMI namespace.[/important]new-wminamespace districtWe can see that if we recall the get-wminamespace command, we will see our new wmi namespace present.


How to get a wmi namespace with powershell?:

We can dig more into the the namespace by retrieving the namespace directly using the following command:

Powershell will return the following results:result of get-wminamespaceThe results show the default WMI system classes wich start with the double underscore “__” and also te name of the WMINamespace which in this case is “District“.

Want more details ? Check this video on how to create a custom wmi namespace.

find here a short video explaining how to create a custom wmi namespace.

Dig more into it! (Referrences):

NameSpaces –>

Ok, that is all for today. Tomorrow, we will talk about custom wmi classes.

A bientôt !  :)[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

Go to Top