Skip to content

Instantly share code, notes, and snippets.

@SibeeshVenu
Created February 8, 2021 11:37
Show Gist options
  • Save SibeeshVenu/8e3181b6e32dab2fefc4c2b1e3b406d3 to your computer and use it in GitHub Desktop.
Save SibeeshVenu/8e3181b6e32dab2fefc4c2b1e3b406d3 to your computer and use it in GitHub Desktop.
$appName = "appname"
$appHomePage = "companyhomepage"
$secretStartDate = Get-Date
$secretEndDate = $secretStartDate.AddYears(10)
$myAdApp = New-AzureADApplication -DisplayName $appName -HomePage $appHomePage -Oauth2AllowImplicitFlow $true -AvailableToOtherTenants $true
$secret = New-AzureADApplicationPasswordCredential -ObjectId $myAdApp.ObjectId -CustomKeyIdentifier "GraphClientSecret" -StartDate $secretStartDate -EndDate $secretEndDate
$secret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment