Creating Collections for CU Updates using PowerShell


When upgrading the System Center Configuration Manager (SCCM) client to a new version, most customers would prefer to create new collections for this task.

As a cosultant I create alot of these “ad-hoc” collections every time I visit a customer, so I’ve created a small libary of PowerShell scripts that will help me create these collections really fast when I need them.

Here is a simple PowerShell script that will create 2 kinds of collections that will help you for this specific task.

  1. #CLI – Client Version; That will have all clients with a specific client version.
  2. #CU – Cumulative Updates; That will have all clients that requires a specific CU update.

Download the PowerShell script here:

I’ll try update the script everythime a new update (CU or Service Pack) are released.

Update: The script has now (3/2-2015) been updated to support SCCM 2012 R2 CU4.

After you run the script you should see the following collections in the console:



+Ronni Pedersen

About Author

My name is Ronni Pedersen and I'm currently working as a Cloud Architect at APENTO in Denmark. My primary focus is Enterprise Client Management solutions, based on technologies like AzureAD, Intune, EMS and System Center Configuration Manager. I'm is also a Microsoft Certified Trainer and Microsoft MVP in Enterprise Mobility.


  1. Love this script! Thank you Ronni.
    If I might I’d like to suggest a modification…add the following line of code so we don’t need to modify the site code name in the script. This will find the name of the site and set-location to it.

    Set-Location $($(Get-PSDrive -PSProvider CMSite).Name + ‘:’)

    Thanks for considering it.

    • Hi Chase,

      Thanks for the tip. It’s a great tip!

      I wanted to change the script, but then I change my mind.
      The reason is that I’ve got customers with multiple site (dev/test/prod) within the same Active Directory.
      So to keep it simple, I’ll stick with the hardcoded site code.

      But thanks for the input.


  2. Thank you for the helpful info on this page as well as on the rest of your site. I have used your resources a number of times to various things, so THANK YOU!

    When I attempt to run this script from my Primary Site server as well as from my tech workstation, I get a strange error which I am not sure how to fix. Here it is:

    “CD : Cannot find drive. A drive with the name ‘P02’ does not exist.”

    I am not sure what to change this drive letter to to correct this issue. The rest of of the script fails entirely because it cannot location this location, of course.

    Thanks for any info you might be able to provide!

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.