Try using the Set-AIPFileLabel by setting the label ID to "None". For example, to remove a label from all files in a local folder:
# Import the AIP module and connect
Import-Module AzureInformationProtection
Connect-AipService
# Set the folder containing files
$FolderPath = "C:\SyncedFiles"
# Recursively remove the label from all files
$Files = Get-ChildItem -Path $FolderPath -Recurse -File
foreach ($File in $Files) {
Set-AIPFileLabel -Path $File.FullName -LabelId "None" -JustificationMessage "Removing label"
}
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin