SCCM 2012 R2: Deleting old CU Packages using PowerShell

0

When you install the latest cumulative update for System Center 2012 Configuration Manager (SCCM), it automatically creates 4 new packages for client, server and console updates.

If you forget to clean up after each update, you’ll end up a situation like this:

clip_image001

Unfortunately the SCCM user interface does not support multiselect and delete, so if you want to delete all these packages, you need to walk through the delete wizard for each package.

That is both extremely boring but also takes a lot of time.

So I wrote this little PowerShell script that will delete all post SCCM 2012 CU4 update packages from a Site Server. If you want to confirm each package before you delete them, just remove the “-Force” from each line.

You can download the script from the Microsoft TechNet Gallery right here:

https://gallery.technet.microsoft.com/SCCM-2012-R2-Deleting-Old-61c0e79d

clip_image003

The Configuration Manager Folder after the script has been executed:

clip_image004

Much better Smiley

/Enjoy

+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.

Leave A Reply

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