-
Notifications
You must be signed in to change notification settings - Fork 386
Description
Reporting an Issue or Missing Feature
This is a bug report regarding the retrieval of SensitivityLabel values using Get-PnPTenantSite
and the compatibility of objects with Get-PnPProperty
. The SensitivityLabel information is not being populated as expected, and Get-PnPProperty
fails to load the property from returned site objects.
Expected behavior
When running the following commands:
$sites = Get-PnPTenantSite
foreach ($site in $sites) {
Get-PnPProperty -ClientObject $site -Property SensitivityLabel
}
or accessing:
$sites[100].SensitivityLabel
Expected result:
The SensitivityLabel
property should return the sensitivity label assigned to each SharePoint site, as visible in the SharePoint Admin Center.
Get-PnPProperty
should successfully populate/load the SensitivityLabel property for each site.
Actual behavior
- The
SensitivityLabel
property on the objects returned byGet-PnPTenantSite
(with or without-Detailed
) is always empty, even though sites have labels assigned. - Attempting to use
Get-PnPProperty -ClientObject $site -Property SensitivityLabel
fails with this error:Get-PnPProperty: Cannot bind parameter 'ClientObject'. Cannot convert the "PnP.PowerShell.Commands.Model.SPOSite" value of type "PnP.PowerShell.Commands.Model.SPOSite" to type "Microsoft.SharePoint.Client.ClientObject".
- This indicates an object type mismatch: the SPOSite object returned is not compatible with the required ClientObject parameter for
Get-PnPProperty
.
Screenshots
- Attempting to use
Get-PnPProperty
produces the above error (see attached screenshot).

- Accessing
$sites[100].SensitivityLabel
always displays an empty value, even for labeled sites (see attached screenshot).

Steps to reproduce behavior
-
Use PnP PowerShell v3.1.141 to connect to SharePoint Online as a tenant administrator.
-
Run:
$sites = Get-PnPTenantSite -Detailed foreach ($site in $sites) { Get-PnPProperty -ClientObject $site -Property SensitivityLabel }
OR
$sites = Get-PnPTenantSite -Detailed $sites.SensitivityLabel
-
Observe that the SensitivityLabel property is always empty, and that
Get-PnPProperty
fails due to a type incompatibility.
What is the version of the Cmdlet module you are running?
PnP.PowerShell v3.1.141
Which operating system/environment are you running PnP PowerShell on?
- Windows
- Linux
- MacOS
- Azure Cloud Shell
- Azure Functions
- Other : please specify