-
Notifications
You must be signed in to change notification settings - Fork 4
/
graphapp
26 lines (18 loc) · 851 Bytes
/
graphapp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
connect-Azuread
$tenantID=(Get-AzureADTenantDetail).ObjectId
$client_secret = "2Uban4QnNvSWqg6mcXdpOL5EyzsTPPixJf6kXgcml3E="
$applicationName="BlogGraphApp"
$homePage = "https://gmarculescu.com"
$appIdURI = "https://gmarculescu.com/?p=584"
$logoutURI = "http://portal.office.com"
$today=[System.DateTime]::Now
$keyId = (New-Guid).ToString();
$today.AddYears($durationInYears)
$applicationSecret = New-Object Microsoft.Open.AzureAD.Model.PasswordCredential($null, $today.addyears(1), $keyId, $today, $client_secret)
$AADApplication = New-AzureADApplication -DisplayName $applicationName `
-HomePage $homePage `
-ReplyUrls $homePage `
-IdentifierUris $appIdURI `
-LogoutUrl $logoutURI `
-PasswordCredentials $applicationSecret
$servicePrincipal = New-AzureADServicePrincipal -AppId $AADApplication.AppId