I wrote a short blog post recently describing how you can semi-automatically update the limiting collection for all collections in a Configuration Manager console folder here.
However, as is commonly the case, a one-time task became something that needed to be done at scale. We suddenly needed to embark on a mass reorganisation of our ConfigMgr objects, including a rethink of the limiting collections. Once the new design was put together it was clear that the limiting collection would need to be updated on almost all the collections.
This was an opportunity I had been waiting on to exercise my PowerShell skills and publish my first module.
Get the module
If you have PowerShell version 5 or above you can grab the module by running the following command:
1 2 3 |
Install-Module -Name CMLimitingCollection |
You can view the project on GitHub here:
https://github.com/markhallen/CMUtilities
You can view it on PowerShellGallery.org here:
https://www.powershellgallery.com/packages/CMLimitingCollection
Usage
To update the limiting collection for a console folder, simply comp the path from the address bar in the console.
Call the Set-LimitingCollectionForFolder function, passing the folder path and the target limiting collection name.
1 2 3 |
Set-LimitingCollectionForFolder -Path "\Assets and Compliance\Overview\Device Collections\Applications" -LimitingCollectionName "Windows desktops" |
Hello, Thanks
I followed the steps and got error below
Set-LimitingCollectionForFolder : The term ‘Set-LimitingCollectionForFolder’ is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:1
+ Set-LimitingCollectionForFolder -Path “\Assets and Compliance\Overvie …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-LimitingCollectionForFolder:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
AM I doing anything wrong?
Hi. You need to install the module first:
Install-Module -Name CMLimitingCollection
To confirm that it has been installed correctly you can run:
Get-Help Set-LimitingCollectionForFolder
This should show the valid params etc for the cmdlet.