The sensitivity label is published by label policies and cannot be deleted - Fixed

[Fixed]: The sensitivity label is published by label policies and cannot be deleted

No comments

 603 total views,  2 views today

In this blog, we will learn how to troubleshoot the error  “The sensitivity label ‘GSD First Test Sensitivity Label’ is published by label policies and cannot be deleted. The following label policies have published this sensitivity label: GSD First Sensitivity Label Test – Policy.”

The error message is shown below in the picture:

The sensitivity label is published by label policies and cannot be deleted error
The sensitivity label is published by label policies and cannot be deleted error

Steps to delete a sensitivity label from the compliance center

Log in to the Microsoft Purview (previously known as Microsoft 365 Compliance Center).

Information protection – Microsoft 365 compliance

Click on the “Information Protection” link from the left navigation area.

Below we can see the dashboard of all sensitivity labels.

Steps to delete a sensitivity label from the compliance center
Steps to delete a sensitivity label from the compliance center

Select any of the sensitivity labels displayed over there.

Double click on the selected label.

Delete sensitivity label from the compliance center label dashboard
Delete the sensitivity label from the compliance center label dashboard

Click on the “Delete Label” button.

Are you sure you want to delete the selected object(s) - sensitivity label
Are you sure you want to delete the selected object(s) – sensitivity label?

Once you click on the “Delete Label” button, we will get the warning message

“Are you sure you want to delete the selected object(s)?” with the “Yes” and “No” buttons.

Click on the “Yes” button.

Error in deleting sensitivity label from the compliance center
Error in deleting sensitivity label from the compliance center

Once, we click on the “Yes” button we will not be able to delete the sensitivity label, the error will say:

“The sensitivity label ‘GSD First Test Sensitivity Label’ is published by label policies and cannot be deleted. The following label policies have published this sensitivity label: GSD First Sensitivity Label Test – Policy.”

Then, how to fix this error and move on to the deletion.

How to fix the error “The sensitivity label ‘GSD First Test Sensitivity Label’ is published by label policies and cannot be deleted.”?

In order to fix the above-mentioned error, first, we need to delete the policy for the sensitivity label which was published but unfortunately, there is no UI in the Microsoft Purview(compliance center) to see the published policy for a sensitivity label as the policy is the background process for a sensitivity label. In this case, we need to take the help of the PowerShell commands.

In the PowerShell part, we have 4 steps:

  • Get All Sensitivity Labels using the Get-Label command
  • Get All Policies using the Get-LabelPolicy command
  • Delete a Policy using the Remove-LabelPolicy command
  • Delete a Label using the Remove-Label command

Get All Sensitivity Labels using the Get-Label command

Referring to the Get sensitivity labels using PowerShell script article list out all the labels.


Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.5
Import-Module ExchangeOnlineManagement
Connect-IPPSSession #This will ask you to enter your Global Admin credential
Get-Label |Format-Table -Property Guid, DisplayName, Name 

Get Sensitivity Labels using the Get-Label PowerShell command

Get Sensitivity Labels using the Get-Label PowerShell command

Now, note down the GUID id of the sensitivity label which you want to delete.

Get All Policies using the Get-LabelPolicy command

Similarly using the below command get all label policies:


Get-LabelPolicy | Format-Table -Property Guid, Name, DisplayName

Get Sensitivity Labels Policy using the Get-LabelPolicy PowerShell command

Get Sensitivity Labels Policy using the Get-LabelPolicy PowerShell command

Now, note down the GUID ID and the Name of the policy which you want to delete.

Delete a Policy using the Remove-LabelPolicy command

Use the below command to delete a sensitivity policy:


Remove-LabelPolicy -Identity "GSD First Sensitivity Label Test - Policy"

Note:

  • Here in the Identity parameter, we can pass either GUID or the name of the policy.

Delete a Label using the Remove-Label command

Using the below command, delete the sensitivity label:


Remove-Label -Identity "GSD First Test Sensitivity Label"

Note:

  • Here also, in the Identity parameter, we can pass either GUID or the name of the policy.

Now, if we go to the sensitivity label dashboard in the Microsoft Purview, we can see that the sensitivity label “GSD First Test Sensitivity Label” has been deleted, we don’t see the error anymore.

Sensitivity Label has been deleted using PowerShell command
The sensitivity Label has been deleted using the PowerShell command

Summary: What we have learned from this troubleshooting blog

Thus, in this article, we have learned the below with respect to troubleshooting the error “The sensitivity label ‘GSD First Test Sensitivity Label’ is published by label policies and cannot be deleted. The following label policies have published this sensitivity label: GSD First Sensitivity Label Test – Policy.”:

  • How to fix the sensitivity label deletion error – the sensitivity label is published by label policies and cannot be deleted
  • How to get sensitivity label using the PowerShell script
  • How to get sensitivity label policy using the PowerShell script
  • How to remove sensitivity label policy using the PowerShell script
  • How to remove sensitivity label using the PowerShell script

Reference

  • For more updates on the sensitivity label PowerShell command, you can refer to this Microsoft article – Remove-Label

 

 

 

 

About Post Author

Do you have a better solution or question on this topic? Please leave a comment