PowerShell Script to Automate Running ContentLibraryCleanup.exe Against All DPs in SCCM Site

This is a rough script that automates the running of the content library cleanup tool available after SCCM Build 1702. The script will connect to a SCCM site to build a list of distribution points to run against. This needs to be ran on the primary site server under account with full admin rights in SCCM. It checks four possible locations for the PS module and the cleanup tool. The script prompts for the SCCM site code, the FQDN of the primary site server, and if you want the tool to delete orphaned content or just log to the tools default log location. Continue reading “PowerShell Script to Automate Running ContentLibraryCleanup.exe Against All DPs in SCCM Site”