Skip to content

Instantly share code, notes, and snippets.

@svarukala
Last active January 10, 2021 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svarukala/1d0c07d1706e378f45f7d715844ba585 to your computer and use it in GitHub Desktop.
Save svarukala/1d0c07d1706e378f45f7d715844ba585 to your computer and use it in GitHub Desktop.
Creates the service principal for PnP PowerShell.
$PnPPowerShellAppId = "31359c7f-bd7e-475c-86db-fdb8c937548e"
az ad sp create --id $PnPPowerShellAppId
#The guid 00000003-0000-0000-c000-000000000000 corresponds to Microsoft Graph
az ad app permission grant --id $PnPPowerShellAppId --api 00000003-0000-0000-c000-000000000000 --scope User.Read.All,Group.ReadWrite.All
#The guid 00000003-0000-0ff1-ce00-000000000000 corresponds to SPO
az ad app permission grant --id $PnPPowerShellAppId --api 00000003-0000-0ff1-ce00-000000000000 --scope User.Read.All,Sites.FullControl.All
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment