Delete SCCM Content Library

Boopathi Subramaniam 3,221 Reputation points
2021-08-30T20:33:14.54+00:00

Hi,

Distribution Role is removed. But SCCMContentLib still exits. Below command is prompting below message even command prompt is opened as administrator.

ContentLibraryCleanup.exe /dp server.fqdn.com /delete

Gathering information...
Loading information from distribution point...
System.Management.ManagementException: Unable to access remote WMI. Please ensur
e that the WMI providers for the site and on the distribution point are both run
ning, and that you have RBAC access to them. You must be running this tool as a
user with administrative rights on the target distribution point. ---> System.Ma
nagement.ManagementException: Unable to access remote WMI. Please ensure that th
e WMI providers for the site and on the distribution point are both running, and
that you have RBAC access to them. You must be running this tool as a user with
administrative rights on the target distribution point. ---> System.Management.
ManagementException: Registry string retrieval was not successful.
at Microsoft.ConfigurationManager.ContentLibraryCleanup.Utils.GetRegistryStri
ngValue(ManagementClass regClass, String subkey, String valueName)
--- End of inner exception stack trace ---
at Microsoft.ConfigurationManager.ContentLibraryCleanup.Utils.GetRegistryStri
ngValue(ManagementClass regClass, String subkey, String valueName)
at Microsoft.ConfigurationManager.ContentLibraryCleanup.CLContentLibrary..cto
r(String remoteDPFqdn, String primarySiteServerFqdn, String primarySiteCode)
--- End of inner exception stack trace ---
at Microsoft.ConfigurationManager.ContentLibraryCleanup.CLContentLibrary..cto
r(String remoteDPFqdn, String primarySiteServerFqdn, String primarySiteCode)
at Microsoft.ConfigurationManager.ContentLibraryCleanup.Program.Main(String[]
args)

Microsoft Configuration Manager
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Jason Sandys 31,181 Reputation points Microsoft Employee
    2021-09-03T15:27:35.32+00:00

    And is the system also the primary site server?

    1 person found this answer helpful.

  2. Amandayou-MSFT 11,051 Reputation points
    2021-08-31T06:35:20.317+00:00

    Hi @Boopathi Subramaniam ,

    The user account that runs the tool must have permissions the same as the Full Administrator security role in Configuration Manager. Please check if the account has the permission.

    Use the content library cleanup command-line tool to remove content that's no longer associated with an object on a distribution point. This type of content is called orphaned content. This tool replaces older versions of similar tools released for past Configuration Manager products.

    Here is the article about Content library cleanup tool, please refer to it:
    https://learn.microsoft.com/en-us/mem/configmgr/core/plan-design/hierarchy/content-library-cleanup-tool#command-line-parameters


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    Note: Non-Microsoft link, just for the reference.


  3. Jason Sandys 31,181 Reputation points Microsoft Employee
    2021-08-31T14:39:46.707+00:00

    Distribution Role is removed.

    Removed from where?