Skip to content
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager

SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager

Written By Anoop C Nair
Last Updated August 19, 2024
Posted In SCCM
SHARE

Let’s understand how to use the SCCM Content Library Cleanup Tool (ContentLibraryCleanup.exe). The SCCM DP content library cleanup helps the admin remove orphaned content. This tool avoids hacking around WMI to remove orphaned content.

ContentLibraryCleanup.exe is NOT a GUI-based tool; instead, it’s a command-line tool. I don’t like command-line tools because they’re easy to make mistakes. So, it would be best if you understood the parameters of the ConfigMgr Content Library Cleanup Tool.

In this post, you’ll find everything about the SCCM Content Library Cleanup Tool. We’ll cover how it helps manage the Distribution Point and the basics of Configuration Manager, breaking down the details into simple, easy-to-understand terms.

Let me put the warning (This tool should be run carefully) as part of the prerequisite because it contains details of permissions required to run the Content Library Cleanup Tool.

Patch My PC

SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager – Requirements

The following are some critical requirements/prerequisites to run this tool.

  • Administrative access to the distribution point.
  • Full Administrator” RBAC role.
  • All” scope.
  • If running the tool remotely, please ensure your network is secure.
  • The tool runs in What-If mode and will not alter the content library.
  • The tool doesn’t support removing content from the site server with a single library.
  • The tool doesn’t support a content-enabled cloud management gateway or a cloud-based distribution point.
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager - Fig.1
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager – Fig.1

Where is ContentLibraryCleanup.exe

The Content Library Cleanup Tool command-line tool is part of the CD.latest folder.

  • F:\Program Files\Microsoft Configuration Manager\cd.latest\SMSSETUP\TOOLS\ContentLibraryCleanup\ContentLibraryCleanup.exe
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager - Fig.2
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager – Fig.2

How to Use the SCCM Content Library Cleanup Tool

You can copy the ContentLibraryCleanup.exe from the site server to the remote DP. Once copied to a remote distribution point, you can run the tool from that DP server. The following are some of the examples that you can use.

ScenarioCommand Line ExampleDetails
What-If @ DPContentLibraryCleanup.exe /dp DPserver1.MEMCM.comDP Server FQDN
What-If @ Secondary server DPContentLibraryCleanup.exe /dp DPserver1.MEMCM.com /ps PrimaryMEMCM.com /sc ABCPrimary Server FQDN and Primary server site code
Deletion @ DPContentLibraryCleanup.exe /dp DPServer.MEMCM.com /deleteRemote DP FQDN
Silent Switch to Delete @ DPContentLibraryCleanup.exe /q /dp DPServer.MEMCM.com /delete/q silent switch
Enable Logging with What-IfContentLibraryCleanup.exe /dp DPServer.MEMCM.com /log C:\Users\Administrator\Desktop/log to enable logging
Enable Logging with DeletionContentLibraryCleanup.exe /dp DPServer.MEMCM.com /delete /log C:\Users\Administrator\Desktop/Log /Delete deletion with logging
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager – Table.1

What If Option with the Content Cleanup Tool

First, we need to analyze the content from the DP to reduce the risk. You can use the What-if mode to identify the orphaned content that would be deleted from the distribution point.

I recommend running the Content Library Cleanup tool’s what-if mode before the deletion. The following are the steps completed by the content library cleanup tool with the What-If parameter.

  • Are you sure you want to proceed (What-If mode)? ‘y’ = yes / ‘n’ = no:: Y
  • Gathering information…
  • Loading information from distribution point…
  • Analyzing local files, 0.00% complete…
  • Analyzing local files, 100.00% complete…
  • Loading package data from provider
  • Loading local package data…
  • Loading distributed packages from provider…
  • System.InvalidOperationException: This content library cannot be cleaned up now because package MEM00020 is not fully installed.
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager - Fig.3
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager – Fig.3

Errors with the Content Library Cleanup Tool

The above screenshot shows an error with the What-If mode. You need to complete the package distribution before you can proceed with using the SCCM DP content library cleanup tool. The screenshot below shows one more error.

NOTE! – If any of the package distribution is failed, then you can’t run this tool. It would be best if you fixed the package distribution for the DP, and then you can run the cleanup tool.

Content Library Cleanup Tool Error – System.InvalidOperationException: This content library cannot be cleaned up now because package MEM00020 is not fully installed.

Primary and DP on same server Error—Approximately 0 bytes would have been freed if this tool had been run in delete mode. Because this distribution point is co-located with its site server, packages may correctly exist in the content library that is not distributed to the distribution point. Package deletion has been disabled.

SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager - Fig.4
SCCM Content Library Cleanup Tool | Distribution Point | Configuration Manager – Fig.4

Resources

SCCM package distribution failed to remote DP

We are on WhatsApp now. To get the latest step-by-step guides, news, and updates, Join our Channel. Click here – HTMD WhatsApp

Author

Anoop C Nair is Microsoft MVP! He is a Device Management Admin with more than 20 years of experience (calculation done in 2021) in IT. He is a Blogger, Speaker, and Local User Group HTMD Community leader. His primary focus is Device Management technologies like SCCM 2012, Current Branch, and Intune. He writes about ConfigMgr, Windows 11, Windows 10, Azure AD, Microsoft Intune, Windows 365, AVD, etc.

Written by

Anoop C Nair is Workplace Technology solution architect with 25+ years of experience in global enterprise organizations such as JP Morgan, Capgemini, etc. Microsoft Certified Trainer. Microsoft MVP from 2015 onwards for consecutive 11+ years! He also conducts Intune and modern workplace tech training for enterprise organizations. He is Blogger, Speaker, and Founder of HTMD Community and HTMD Conference. His main focus is on Device Management technologies like Intune, Windows, Cloud PC. He writes about technologies like Intune, SCCM, Windows, Cloud PC, Windows, Entra, Microsoft Security.

Discussion

Join the discussion

Your email address will not be published. Required fields are marked *

Related guides

Intune

Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws

Key Takeaways Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws! In the July 2026 Patch, Microsoft introduced new features designed to improve the overall Windows experience. The update adds enhancements to Windows Update for more flexible update management and introduces Point-in-Time Restore, providing an additional recovery option for […]

AC Anoop C Nair 9 min read
Intune

2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws

Key Takeaways 2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws! The June 2026 Windows 11 Patch Tuesday update brings several improvements to File Explorer. It adds support for additional archive formats, including UU, CPIO, XAR, and NuGet Packages (NUPKG). The update also preserves View and Sort preferences in […]

AC Anoop C Nair 10 min read
Intune

2026 May KB5089549 KB5087420 Windows 11 Patch | 0 Zero Day Vulnerabilities and 120 Flaws

Key Takeaways The Windows 11 May 2026 Patch KB5089549 KB5087420 Update brings important security fixes, performance improvements, and reliability enhancements across the operating system. The update introduces new features such as Xbox Mode for gaming, File Explorer improvements, enhanced input and sharing experiences, better taskbar and Windows Hello reliability, and additional enterprise management capabilities for […]

AC Anoop C Nair 8 min read
SCCM

ConfigMgr 2603 Introduces New Early Update Enrollment Process

Key Takeaways In this post we are discussing the ConfigMgr 2603 Introduces New Early Update Enrollment Process. Microsoft has officially released Configuration Manager version 2603 to the Early Update Ring, giving organizations an opportunity to test upcoming improvements before the global production rollout. The release is targeted at enterprises running ConfigMgr version 2409 or later […]

AC Anoop C Nair 3 min read