Skip to content

Instantly share code, notes, and snippets.

@pkbullock
Created November 11, 2020 00:35
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 pkbullock/f6e6359000520b2157ae7d44fa5bd03e to your computer and use it in GitHub Desktop.
Save pkbullock/f6e6359000520b2157ae7d44fa5bd03e to your computer and use it in GitHub Desktop.
Register Azure AD app using PnP PowerShell
Initialize-PnPPowerShellAuthentication -ApplicationName CaPa.Reporting `
-Tenant "tenant.co.uk" -Store CurrentUser -ValidYears 2 `
-CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)
# Output Example from PS:
#
# AzureAppId Certificate Thumbprint
# ---------- ----------------------
# c53eb8da-8bdf-44f9-8718-1fb1bbbbbb EC1E61510AEC35624AF78FEA763D00000000
#
# Example Test Connection
Connect-PnPOnline -ClientId c53eb8da-8bdf-44f9-8718-1fb1bbbbbb `
-Thumbprint EC1E61510AEC35624AF78FEA763D00000000 `
-Tenant "tenant.co.uk" -Url "https://tenant.sharepoint.com"
Get-PnPSite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment