SOLVED

SharePoint + Powershell + sensitivity labels

Copper Contributor

Hi,

is there anyway to find out which sensitivity labels are applied to specific SharePoint site (using Powershell)?

Kr,

Dino

7 Replies
Hello, what about:

get-sposite | ft Url, SensitivityLabel
Unfortunately, doesn't work.
What if you query a specific site? Some properties might not be shown if you get all sites.

@Andres Gorzelany Hi, not an PowerShell guru at all but can confirm that Get-SPOSite with "sensitivitylabel" doesn't work against multiple sites so you have to specify that.

 

@Dino_Vo 

Just examples

Get-SPOSite -Identity xxx | select sensitivitylabel

Get-Label | ft name, guid

Get-Labelpolicy | ft name, guid

 

 

yes Christian, it is a known limitation specially with -Filter and -Limit parameters. Thanks!
Considering the amount of properties that may have default value we better link to https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/get-sposite?view=sharepoint-ps as well (note section).
best response confirmed by Dino_Vo (Copper Contributor)
Solution
@Dino_Vo - You can use the following to get a list of Sensitivity Labels:
Get-Label |Select Name, Guid

Then use the following to get a list of SharePoint sites with Sensitivity Labels applied:
$Sites = Get-SPOSite
Foreach ($Site in $Sites)
{
Get-SPOSite -Identity $Site.Url | Select Url, SensitivityLabel
}
1 best response

Accepted Solutions
best response confirmed by Dino_Vo (Copper Contributor)
Solution
@Dino_Vo - You can use the following to get a list of Sensitivity Labels:
Get-Label |Select Name, Guid

Then use the following to get a list of SharePoint sites with Sensitivity Labels applied:
$Sites = Get-SPOSite
Foreach ($Site in $Sites)
{
Get-SPOSite -Identity $Site.Url | Select Url, SensitivityLabel
}

View solution in original post