Cannot find Sensitivity ID to apply a label with PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-1916369%22%20slang%3D%22en-US%22%3ECannot%20find%20Sensitivity%20ID%20to%20apply%20a%20label%20with%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1916369%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22x-hidden-focus%22%3EHi%20everyone%2C%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3EI%20created%20and%20publish%26nbsp%3B%3CSPAN%3ESensitivity%20labels%20the%20followings%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Sensitivity.JPG%22%20style%3D%22width%3A%20551px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F235010i744B7B79FBCD096D%2Fimage-dimensions%2F551x327%3Fv%3D1.0%22%20width%3D%22551%22%20height%3D%22327%22%20role%3D%22button%22%20title%3D%22Sensitivity.JPG%22%20alt%3D%22Sensitivity.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E%3CSPAN%3EAnd%20I%20use%20Powershell%20to%20apply%20Sensitivity%20as%20the%20following%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22errorSenti.JPG%22%20style%3D%22width%3A%20598px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F235012iF9909A75748E35FA%2Fimage-dimensions%2F598x405%3Fv%3D1.0%22%20width%3D%22598%22%20height%3D%22405%22%20role%3D%22button%22%20title%3D%22errorSenti.JPG%22%20alt%3D%22errorSenti.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E%3CSPAN%3EI%20can%20get%20ID%20but%20I%20use%20this%20ID%20to%20apply%20Sensitivity%20label%20then%20has%20the%20error%20above.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E%3CSPAN%3EI%20use%20%3A%26nbsp%3BSet-AIPFileLabel%20-Path%20D%3A%5CDocumentTest%5C%20-LabelId%207de79cc8-8618-4629-97dc-981860a8f817%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3E%3CSPAN%3EError%20%3A%20Set-AIPFileLabel%20%3A%20Can't%20find%20label%20ID%3A%207de79cc8-8618-4629-97dc-981860a8f817%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22x-hidden-focus%22%3EPlease%20help%20me%20resolve%20this%20error.%3C%2FP%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3CP%3EJohn%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1943843%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20find%20Sensitivity%20ID%20to%20apply%20a%20label%20with%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1943843%22%20slang%3D%22en-US%22%3EHave%20you%20checked%20if%20the%20label%20is%20included%20in%20the%20Labelpolicy%20by%20using%20the%20Get-LabelPolicy%20cmdlet%3F%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fexchange%2Fget-labelpolicy%3Fview%3Dexchange-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fexchange%2Fget-labelpolicy%3Fview%3Dexchange-ps%3C%2FA%3E)%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi everyone,

I created and publish Sensitivity labels the followings:

 

Sensitivity.JPG

And I use Powershell to apply Sensitivity as the following:

errorSenti.JPG

I can get ID but I use this ID to apply Sensitivity label then has the error above.

I use : Set-AIPFileLabel -Path D:\DocumentTest\ -LabelId 7de79cc8-8618-4629-97dc-981860a8f817

Error : Set-AIPFileLabel : Can't find label ID: 7de79cc8-8618-4629-97dc-981860a8f817

Please help me resolve this error.

Thank you,

John

1 Reply
Have you checked if the label is included in the Labelpolicy by using the Get-LabelPolicy cmdlet? (https://docs.microsoft.com/en-us/powershell/module/exchange/get-labelpolicy?view=exchange-ps)