Deletion files/folders with retention labels in a specific SharePoint Online site

Copper Contributor

Hi All,

I have been asked to delete few folders with old files, which doubles with same folders in other location. There are retention labels applied to the files.

I cannot delete those specific folders and subfolders because of the labels (although I do not receive any error messages), as SP admin and I had to change the labels to 'None' on file by file basis and then delete...This takes lots off effort and time as I have lots to do.

 

My question is - Is there a way (GUI or PowerShell) to remove or change the labels to 'None' in specific SP library or folder (and subfolders) so they can be deleted?

 

I do not want to change/delete/remove labels for the whole tenant - but just on library/folder/subfolder level.

All I can see is either remove or add labels in Compliance centre for the whole M365 and tenant..

Thanks in advance!

 

8 Replies

You'll need to remove the label from those items first, this is done on each item individually, not via the SCC.

Hi @Vasil Michev - thanks for fast reply.

 

That was part of my question - how to remove them?

I mean easily? I was going to each subfolder and selecting each file(s) and setting the Labels to 'None'.

But this requires lots of that action as there are lots of subfolders and subfolders etc.

Is there a Powershell I can use to select the url - i.e. https://tenant.com/sites/mysite/Documents/folder/ and the run a command towards that folder to set labels on all items within it to a label 'None'?

 

If I select the folder and set the label to 'None', then the files in the subfolders retain the label and does not allow me to delete..

 

There is not much on that topic on internet, i'm surprised...

Regards,

Roumen

Hi @RSWork ,

 

If the labels have not been set individually on files then you can change the label at the highest folder you want to delete and the label will cascade. I haven't yet had to remove labels via powershell sorry. 

 

In your case it may either take a bit of time to update or the labels have been set individually. 

@Andrew Hodges Updating the folder retention label did not affect the files in it and they are still having a retention label that is preventing deletion. Is there any other way to remove the retention label in bulk? Thanks

We also have a need for bulk or automated removal
Did you manage to find a solution for this?

This is really weird.

 

Files with rentention label can be deleted

Folders with retention label cannot be deleted.

 

What is the logic behind?

 

 

 

@Andrew_Woo 

I would guess that Files within the Folder have had Retention Labels applied at some point, and thus the Folder effectively inherits the retention policy. Files that have been deleted are sent to the Preservation Hold Library, and normally are not viewable by users. The deleted items are held for the period of retention, then silently deleted (or otherwise depending on the retention settings applied). You may find if you trawl thru your SP Recycle Bin there will be items with retention applied that have not been permanently deleted. You could try restoring these items, then removing, or changing to a label that does not include retention, before deleting (folder can now be deleted).

 

All: We need to delete some legacy Retention Labels that were applied to items scattered across our tenant. We expected to be able to delete the Policy and Label(s) from the Compliance Centre, resulting in the labels disappearing from any applied items. Is this still the case? MS documentation now states that Retention Labels cannot be deleted after being applied to items? https://learn.microsoft.com/en-us/microsoft-365/compliance/file-plan-manager?view=o365-worldwide#del... 
We have approx 500 items to de-label, so would like to manage centrally via the admin centres if possible.