Remove expired and superseded updates, SCCM

I have SCCM 2012 R2 and I have to remove superseded and expired updates in all my groups.
Actually, it is quite impossible to remove completely the package appearance from update groups!

But there is a script that clear every update membership if the update has expired or superseded status.

To install this menu you have to download and install Clean-CMSoftwareUpdateGroup.ps1
https://gallery.technet.microsoft.com/Remove-Expired-Superseded-f35495e1

Extract this archive in c:\temp

Open PowerShell console. Move to the c:\temp\Clean-CMSoftwareUpdateGroup directory and execute:
.\Invoke-ToolInstallation.ps1 -SiteServer SITECODENAME -Method Install -Path C:\Scripts -Verbose
If you recieve an error about "execution of scripts is disabled on this system" you have to type:
Set-ExecutionPolicy RemoteSigned
If you want to clear expired un superseded updates appearance under update groups, then you have to:
1) Delete software update deployment:
2) Delete software grpup by itself:
3) Modify policy:
4) Make sure you have option "Enable the deployment after this rule is run" on!:
Execute new policy:

No comments: