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.
- #CLI – Client Version; That will have all clients with a specific client version.
- #CU – Cumulative Updates; That will have all clients that requires a specific CU update.
Download the PowerShell script here:
https://gallery.technet.microsoft.com/SCCM-Creating-Collections-f334c7f0
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:
Enjoy.
7 Comments
Very handy as we are getting ready to upgrade. Thanks!
Glad you liked them…
FYI: CU4 was relased a few sec. ago, so if you download the script again, it has now been updated to support SCCM 2012 R2 CU4.
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.
-Ronni
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!
Hi Daren,
P02 is the SCCM SiteCode.
You need to change that to match your site code.
I knew it would be simple, thanks for the speedy reply!!