Microsoft Entra Suite Tech Accelerator
Aug 14 2024, 07:00 AM - 09:30 AM (PDT)
Microsoft Tech Community

Is there way to bulk upload One Drive URLs into a Microsoft Purview Auto Label Policy?

Copper Contributor

When you have 60+ OneDrive accounts to add to 7+ Autolabeling policies, the single URL upload option through the GUI can become a bottleneck very quickly.


Anyway to do this programmatically in PowerShell for Autolabeling policies that are already set up in Purview? I have the desired OneDrive URLs in a CSV file. 

 

Or any other known workarounds?

 

Thanks!

 

Luke Fisher

1 Reply

Hi @Luke_Michael_Fisher,

 

You can use PowerShell as shown in the following example:

$odLocations = @("<OneDriveLocation1>","<OneDriveLocation2>")
Set-AutoSensitivityLabelPolicy -Identity <AutoLabelingPolicyName> -AddOneDriveLocation $odLocations -ApplySensitivityLabel <Label> -Mode TestWithoutNotifications

 

https://learn.microsoft.com/en-us/powershell/module/exchange/set-autosensitivitylabelpolicy?view=exc...

 

Thanks and regards