Create secret with Powershell for Azure App registration

$startDate = Get-Date
$endDate = $startDate.AddYears(80)
$ObjectID = "132645645-d39e-4658-ab92-306cbb637421"
$Name = "SecretName"
Connect-AzureAD
$aadAppsecret01 = New-AzureADApplicationPasswordCredential -ObjectId $ObjectID  -CustomKeyIdentifier $Name -StartDate $startDate -EndDate $endDate
$aadAppsecret01.value

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.