Configuration Manager Collection Creation and Removal Scripts
Update - July 3rd, 2026 I recently revisited this script for the first time in a few years and ended up rewriting large parts of it. The collection creation script is now order-independent (the rows in the CSV file no longer need to be sorted by dependency), validates the entire CSV file before touching Configuration Manager, and supports fully unattended runs. I also wrote a new companion script, Remove-Collections.ps1, that bulk deletes collections. I’ve updated and expanded this post to cover both scripts. For details on what has changed, see the “What Changed” section at the bottom of this post. ...