powershell icon indicating copy to clipboard operation
powershell copied to clipboard

Issue with New-PnPSite and attempting to set a Sensitivity Label at creation

Open Sharepoint2k22 opened this issue 8 months ago • 0 comments

Reporting an Issue or Missing Feature

I am using Azure Automation Runbook with a Managed Identity that has Sites.FullControl.All permissions in SharePoint.

We are connecting to the Admin Centre and using New-PnPSite to create a site whilst specifying the -SensitivityLabel parameter and label name.

Expected behavior

The site to be created with the label applied

Actual behavior

Site creates as expected but without the label applied.

Note that when connecting to the admin centre using an interactive PnP PowerShell session, this works as expected.

We are wondering if additional permissions may need to be granted to the Managed Identity.

Steps to reproduce behavior

Connect-PnPOnline $AdminURL -ManagedIdentity New-PnPSite -Type TeamSiteWithoutMicrosoft365Group -Url $Url -Title $Title -Owner $Owner -SensitivityLabel $SensitivityLabel

What is the version of the Cmdlet module you are running?

PnP PowerShell 2.4.0

Which operating system/environment are you running PnP PowerShell on?

  • [x] Windows
  • [ ] Linux
  • [ ] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ ] Other : please specify

Sharepoint2k22 avatar Jun 19 '24 12:06 Sharepoint2k22