Last active
April 20, 2024 08:08
-
-
Save LauraKokkarinen/6ed840b89e6eced41fc31e63fb2a32a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure these four variable values before running the script | |
$tenantName = "the prefix of your tenant before .sharepoint.com" | |
$clientId = "the GUID you copied from the Entra ID application registration" | |
$certPath = "C:\some_local_directory\cert_name.pfx" | |
$certPassword = "the password you used when generating the certificate" | |
$adminSiteUrl = "https://" + $tenantName + "-admin.sharepoint.com" | |
$password = (ConvertTo-SecureString -AsPlainText $certPassword -Force) | |
Connect-PnPOnline -Url $adminSiteUrl -ClientId $clientId -CertificatePath $certPath -CertificatePassword $password -Tenant "$($tenantName).onmicrosoft.com" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment