Friday, 15 June 2012

How to delete orphaned & locked SCCM folders

You are unable to delete orphaned locked console folders on a mid tier site that is also not visible at its parent site.

Analysis and solution:
A "locked" object in SCCM means that the object was created on a parent site so cannot be edited at a child primary site as indicated by a padlock on the console object. This is determined by the SourceSite value for the CI in the SCCM database at each primary site in the hierarchy.

For orphaned CI's that are not visible at its parent site, it is possible to manually set their SourceSite value to the site code where the CI is visible. It can then be modified\deleted in the console.

How to 'unlock' a CI in the SCCM database:
1. Perform a successful SCCM site backup.

2. Use the following SQL commands to update the folder CI in the database with the site code for the current site. This will 'unlock' the CI and allow it to be deleted or modify it in the console. Any changes made to the newly unlocked CI should replicate to child primary sites.

Declare @FolderName varchar( 32 )
Set @FolderName = 'My App Folder'
Declare @ParentSite varchar( 32 )
Set @ParentSite = 'ABC'

-- Before updating parent site code.
Select * from Folders where Name = @FolderName and ParentContainerNodeID = '0'
-- Updating parent side code.
-- Update Folders
-- Set SourceSite = @ParentSite --effected child primary site code
-- Where Name = @FolderName --effected folder name here
--and ParentContainerNodeID = '0' -- Effects only folders in the console root.
--After updating parent site code.
Select * from Folders where Name = @FolderName and ParentContainerNodeID = '0'

If the wrong CI is updated that does exist at a parent site then the next time any change is made to the parent CI  then the CI's all child primary sites will be updated to mirror the top level CI.

Note: Modifying the SCCM site database is totally unsupported by Microsoft and you are taking your life in your own hands by doing so. This information is for reference only and should not be used without direct consultation with Microsoft Premier Support Services.

No comments:

Post a Comment