In Microsoft System Center Configuration Manager we can automate recurring tasks or batch jobs using PowerShell.
Limiting collections - given a collection folder the limiting collection of each collection therein will be set to the value specified.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- PowerShell
- The SCCM console is required
- An account with permission to modify collections
Copy locally and then import the module.
Import-Module .\CMLimitingCollection\CMLimitingCollection.psm1
Import-Module -Name CMLimitingCollection
You can view the module on the PowerShellGallery here.
- Copy the folder path from the console folder
- Invoke the Set-LimitingCollection funtion and paste the console folder path and the target limiting collection name
Set-LimitingCollectionForFolder -Path "\Assets and Compliance\Overview\Device Collections\Applications" -LimitingCollectionName "Windows desktops"
Set-LimitingCollectionForFolder -Path <String> -LimitingCollectionName <Object> [-SiteCode <String>] [-SiteServer <String>] [<CommonParameters>]
Set-LimitingCollectionForFolder -Path <String> -LimitingCollectionId <Object> [-SiteCode <String>] [-SiteServer <String>] [<CommonParameters>]
.PARAMETER Path
The path to the console folder containing the collections to be updated.
.PARAMETER LimitingCollectionName
The name of the new limiting collection.
.PARAMETER LimitingCollectionId
The CollectionId of the new limiting collection.
.PARAMETER SiteCode
[Optional] Connect to the specified site. If no value is provided the default site
used by the locally installed SCCM client will be used.
.PARAMETER SiteServer
[Optional] Connect to the specified site server. If no value is provided the default site
server used by the locally installed SCCM console will be used.
Unit tests can be run using Invoke-Pester
- PowerShell
- Microsoft System Center Configuration Manager
- Pester
- PowerShell 5.1
- Microsoft System Center Configuration Manager 1706
- Pester 3.4.0
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Mark Allen - Initial work - markhallen
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details