How to remove sensitivity labels from PDFs automatically
We are using Microsoft Defender for Cloud Apps to automatically apply sensitivity labels to bulk uploaded (from scanner) PDF files --> this works fine!
However it seems impossible to find a reliable way remove the labels automatically again (unattended/programatically). In our process we need to combine multiple AIP protected PDFs to be submitted as a single password protected PDF (non AIP), ideally we achieve this through an API and Power Automate to do this instantly on request.
So far explored the following options:
- SharePoint REST API: https://www.linkedin.com/pulse/programatic-way-apply-sensitivity-label-file-sanjoyan-mustafi/
- Unlock-SPOSensitivityLabelEncryptedFile (it runs, no error whatsoever, but no effect on PDFs) - https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/unlock-sposensitivitylabelencryptedfile?view=sharepoint-ps
- Running Set-AIPFileLabel from Azure PowerShell function - https://learn.microsoft.com/en-us/answers/questions/937626/error-running-set-aipfilelabel-from-azure-powershe.html
- Copy (keep duplicates of) all protected PDF files to a separate SharePoint library and use the same Defender for Cloud Apps policy method to remove or apply a label without encryption. Both applying or removing options appear in to be matched and completed but have no effect, PDF files are untouched!
Any suggestions as too how to achieve the automated removal of sensitivity labels from PDFs would be greatly appreciated!
Azure Information Protection
Microsoft 365 and Office | SharePoint | For business | Windows
