Forum Discussion

Jake-2415's avatar
Jake-2415
Copper Contributor
Aug 16, 2023

Orphaned Parent Labels

Hello, 

 

When testing I created a label that was used as the default in a label policy. I have since used the same label as a parent label to multiple sublabels. The issue is I now have orphaned parent labels that have been applied to items. I would like to lift and shift all items labeled with a parent label to one of the sub labels. 

 

I have not found a good way to do this programmatically. 

 

For instance 100 Items labeled "Internal". 

 

Internal is now the parent label to "Internal - General", and "Internal - HR" Neither Parent label or Sub Labels have a protection template associated with them. However, when I run the PS against the Parent label to delete, I obviously cannot as it exists as a parent label. 

 

Is there a good way to grab the GUID for each and apply one of the newer sublabels so I no longer have orphaned labels?

3 Replies

    • Jake-2415's avatar
      Jake-2415
      Copper Contributor

      folucian 

       

      Thank you for the reply. I would not be moving an already labeled item from one parent label to another but from a parent label to a sublabel created under the parent label. I have written some PS to accomplish but so far I have been unable to complete the task programmatically. 

       

      The parent label was used for testing and the sublabel was created under the parent label after testing was complete, so, I have 40k labeled documents with an orphaned label. Relabeling manually wouldnt really be an option. 

Resources