Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#Connect using your tenants SharePoint admin url.
Connect-PnPOnline -Url M365x28850929-admin.sharepoint.com -Interactive
#Enter the App ID you coped from the Enterprise Application.
$ManagedIdentityID = "4bf49741-7819-47f1-9e30-c36ef6b9d1aa"
Add-PnPAzureADServicePrincipalAppRole -Principal $ManagedIdentityID -AppRole "Sites.ReadWrite.All" -BuiltInType MicrosoftGraph
Add-PnPAzureADServicePrincipalAppRole -Principal $ManagedIdentityID -AppRole "Sites.FullControl.All" -BuiltInType MicrosoftGraph
Add-PnPAzureADServicePrincipalAppRole -Principal $ManagedIdentityID -AppRole "Sites.FullControl.All" -BuiltInType SharePointOnline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment