So now that ConfigMgr CB 1702 is with us, in this post I am going to focus on one of the nice new features, namely the Content Library Cleanup tool – ContentLibraryCleanup.exe.
Maintenance.. Maintenance.. & More Maintenance
Prior to CB 1072 when content was orphaned on a distribution point, the process of removing this redundant data was in the hands of the ConfigMgr admin. If you are distributing a significant number of packages, over time the amount of redundant data can be significant and the process of cleaning this data up manually can be both difficult and time consuming to orchestrate in a large environment.
In the latest current branch release, the product team have included a little gem to take care of this part of your essential maintenance toolkit, namely the ContentLibraryCleanup.exe tool.
The ContentLibraryCleanup.exe Tool
This new utility is a command line based program that compares the content of distribution points with the packages currently deployed from a specified site server. This way a map of the content is built up and the redundant objects are flagged by the tool for deletion.
Running the tool is a simple process;
- Obtain the ContentLibraryCleanup.exe from the following directory on your site server in your primary site – %CM_Installation_Path%\cd.latest\SMSSETUP\TOOLS\ContentLibraryCleanup\
- Open a Command Prompt / PowerShell Console and use the utility using the following format to get an estimate of how much data can be saved;
– ContentLibraryCleanup.exe /dp “Name of your distribution point to clean” /ps “FQDN of the primary site that the distribution point belongs to” /sc “Site code that the DP belongs to”
Content Library Cleanup Tool – Analysing
Failed to Deploy
Where content is found which failed to distribute, you might receive an error like the below;
In this instance you will need to remove the distribution point from the identified package.
The Microsoft documentation notes this in the known issues section;
Known issue When the tool is run, an error like the following might be returned when any package or deployment has failed, or is in progress:
- System.InvalidOperationException: This content library cannot be cleaned up right now because package is not fully installed.
Workaround: None. The tool cannot reliable identify orphaned files when content is in progress or has failed to deploy. Therefore, the tool will not allow you to clean-up content until that issue is resolved
Huge Potential For Savings
So after a quick analysis of data on a test DP, I was surprised to see the following;
So in an instance whereby a small branch office DP serving 100 clients had just shy of 40GB’s of wastesd space, just think about the potential to automate the process of cleaning up your entire estate and the resulting disk space savings.
Cleaning Up Your Distribution Points
Running the tool to silently automate the deletion of redundant content is just a matter of including the /delete & /q switches.
After the cleanup process has completed you will have a log similar to the one below;
Looking at the server in question we can now verify the space savings;
Pre – Content Library Clean Up
Post – Content Library Clean Up
More info on this addition to ConfigMgr can be found on Mirosoft’s documentation site – https://docs.microsoft.com/en-us/sccm/core/plan-design/hierarchy/content-library-cleanup-tool