Last active
May 10, 2020 21:03
-
-
Save nicolonsky/e3f94acd49d51ab66ca3a4c9a7ce37a8 to your computer and use it in GitHub Desktop.
Create Azure AD App Registration Client Credential Certificate
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
$displayName = "Microsoft Graph PowerShell Client Credentials" | |
$notAfter = $(Get-Date).AddYears(1) | |
$cert = New-SelfSignedCertificate -CertStoreLocation cert:\currentuser\my -DnsName graph.microsoft.com -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter $notAfter -FriendlyName $displayName | |
$export = Export-Certificate -Cert "cert:\currentuser\my\$($cert.Thumbprint)" -FilePath "c:\temp\$displayName.cer" | |
Write-Output "Exported certificate '$($cert.Thumbprint)' to '$($export.FullName)'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment