Cannot delete a sensitivity label with remove-label command in powershell

Wilt Rovira 1 Reputation point
2020-08-17T16:25:15.92+00:00

I am trying to delete a sensitivity label with remove-label command in powershell. Any advice?

PS C:\> Get-Label

Name Disabled


General False
WARNING: OnAfterGetLabels: failed to get template:[8c5baa1c-c20e-4b0b-9037-976ac2df69f0]
PII False

PS C:\> Remove-Label -Identity 'PII'

WARNING: Encountered exception: Microsoft.Exchange.Management.Transport.ErrorCannotRemovePendingDeletionRuleException:
We cannot remove rule 'PII' since it is already in pending deletion state.
at Microsoft.Exchange.Configuration.Tasks.Task.ThrowError(Exception exception, ErrorCategory errorCategory, Object
target, String helpUrl)
at Microsoft.Office.CompliancePolicy.Tasks.RemoveComplianceRuleBase.InternalValidate()
at Microsoft.Office.CompliancePolicy.Tasks.RemoveLabel.InternalValidate()
WARNING: Validation failed: Microsoft.Exchange.Management.Transport.ErrorCannotRemovePendingDeletionRuleException: We
cannot remove rule 'PII' since it is already in pending deletion state.
at Microsoft.Exchange.Configuration.Tasks.Task.ThrowError(Exception exception, ErrorCategory errorCategory, Object
target, String helpUrl)
at Microsoft.Office.CompliancePolicy.Tasks.RemoveComplianceRuleBase.InternalValidate()
at Microsoft.Office.CompliancePolicy.Tasks.RemoveLabel.InternalValidate()

Azure Information Protection
Azure Information Protection
An Azure service that is used to control and help secure email, documents, and sensitive data that are shared outside the company.
538 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,517 questions
{count} votes

2 answers

Sort by: Most helpful
  1. KyleXu-MSFT 26,261 Reputation points
    2020-08-18T01:46:02.267+00:00

    We cannot remove rule 'PII' since it is already in pending deletion state.

    You can use command below to check the status of this sensitivity label:

    Get-Label labelName| fl DisplayName,Mode  
    

    18103-snipaste-2020-08-18-09-40-23.png

    If this label is real in "PendingDeletion" state, I think you will not need to manage it, it will be disappeared in the later. If it still exist after 24 hours, you could open a service request to let Microsoft check from the backend.

    1 person found this answer helpful.

  2. Vikas Dwivedi 1 Reputation point
    2021-02-25T07:45:34.577+00:00

    Did we find solution to this .... facing similar issue while trying to delete label.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.