Create an SCCM folder with Powershell WMI

Create an SCCM folder with Powershell WMI

Being a IT professional leads to many functions :). Here is one for creating a container node aka. SCCM folder.

The function uses the write-log function which you can find here

In this case I have defined two global variables in top of the script so its not needed to declare server and site when calling the function:

First I fetch the parent node ID with this query, if not used, the folder will be in the first level of folders.
In this example we fetch the folder id for ‘Hardware limited collections’ in the device collection instance:

Here I use the parent folder ID to create a subfolder in ‘Hardware limited collections’ in the device collections instance:

Here I use the function to create a main/root folder in the device collections instance:

The same can be done for the user collections instance:

Screenshot of the output:

You can read more about the SMS_ObjectContainerNode class here

Please write a comment for help or suggestions

Leave a comment