Ever since I released the console extension for ConfigMgr to clean up Software Update Groups from expired and/or superseded Software Updates, many have given me lots of feedback and I’m now pleased to announce that I’ve updated the script with a new version. In this new version of the Clean-CMSoftwareUpdateGroups.ps1 script, the total execution time hav been improved enormously. Previously it could take minutes to complete the clean up process, but with the new version it only takes a couple of seconds (at least in my demo environment and at some customers where I’ve tested this). I’ve also added two new options for you to choose how to perform the clean up process, you can read more about that below.

With this updated script, you now have the option to clean your Software Update Groups by the following criteria:

  • Expired and Superseded (Remove content)
  • Expired and Superseded (Keep content)
  • Expired Only (Remove content)
  • Expired Only (Keep content)
  • Superseded Only (Remove content)
  • Superseded Only (Keep content)

Download the console extension

You can download the console extension from the TechNet Gallery.

Installation

Refer to the installation documentation on the following blog post:

http://www.scconfigmgr.com/2015/03/15/clean-software-update-groups-console-extension-for-configmgr-2012/

Let me know if you have any questions or suggestions.

Nickolaj Andersen
Principal Consultant and Enterprise Mobility MVP. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows deployments and Automation. In 2015 Nickolaj was awarded as PowerShell Hero by the community for his script and tools contributions. Author of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService and a frequent speaker at user groups.

(837)

comments
  • Sandy
    Posted at 13:26 December 15, 2015
    Sandy
    Reply
    Author

    Does it work on ConfigMgr v1511? šŸ™‚

    • Nickolaj
      Posted at 13:29 December 15, 2015
      Nickolaj
      Reply
      Author

      Hi Sandy,

      It sure does. I’ve tested it on the following versions:

      – ConfigMgr 2012 R2
      – ConfigMgr 2012 R2 SP1
      – ConfigMgr 1511

      Regards,
      Nickolaj

  • Tim
    Posted at 17:14 December 15, 2015
    Tim
    Reply
    Author

    Thanks for updating this script. It works GREAT!

    • Nickolaj
      Posted at 17:18 December 15, 2015
      Nickolaj
      Reply
      Author

      Hi Tim,

      You’re very welcome!

      Regards,
      Nickolaj

  • Baard
    Posted at 18:55 December 15, 2015
    Baard
    Reply
    Author

    Hi!
    Just ran your script, but it did not seem to remove content from the different SUPs when i ran Expired only nor Superseded only, (both the Remove content version).

    It was only when i ran Expired and Superseded (remove content) that the content actually disappeared.
    Since there are no log files to peruse, i just caught a glimpse on the verbose that there was nothing to remove in the to first, whereas i could see some verbosity about removing content when running Expired and Superseded.

    Any tips or thoughts?

    • Nickolaj
      Posted at 19:42 December 15, 2015
      Nickolaj
      Reply
      Author

      Hi Baard,

      It’s by design, because a Software Update can be in the following states:

      – Expired and Superseded
      IsExpired = True
      IsSuperseded = True

      – Expired Only
      IsExpired = True
      IsSuperseded = False

      – Superseded Only
      IsExpired = False
      IsSuperseded = True

      So for instance in an environment where you’re not delaying supersedence and expire information, a Software Update would be expired and superseded at the same time. Therefor when running the Expired Only option for instance, it will check if Software Update instance is _ONLY_ expired šŸ™‚

      Regards,
      Nickolaj

      • Baard
        Posted at 12:55 December 17, 2015
        Baard
        Reply
        Author

        Ah, ok, all is well then, thanks šŸ™‚

  • Sonny
    Posted at 09:50 December 17, 2015
    Sonny
    Reply
    Author

    Hi Nickolaj,

    Many Thanks for this Great Job !
    Can we use this script with command line not with console extension and only for one Software Update Group ?
    And can we use correctly the “remove content” with a DFS share folders ?
    It was not always correct with previous script (version of November 18, 2014)
    Regards
    Sonny

  • Li Xiang
    Posted at 15:19 December 31, 2015
    Li Xiang
    Reply
    Author

    Hi
    Thank you very much for post this solution !
    My question is if to use (Remove Content) option, it will remove the downloaded update files from the software update packages? and also do a refresh of the packages?
    Just want to avoid to refresh many packages at same time.
    Thank you.

  • James
    Posted at 01:02 January 22, 2016
    James
    Reply
    Author

    TERRIFIC JOB!

  • shashidhar
    Posted at 14:09 January 31, 2016
    shashidhar
    Reply
    Author

    Hi ,

    i want to stop/disable windows services, how can i do that by using SCCM?

  • Leave a Reply