Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $clientID="7c6cbd92-073b-4bc9-9d4a-fc27749f340b";
- $newClientSecret = "p/zEuKBqkZRQsz6yRpOafj2f6zZdnQYvONatGWj0N0M=";
- $appDomain="Yourdomain.azurewebsites.net";
- $appUrl="https://Yourdomain.azurewebsites.net/";
- $appName="Your App Name"
- $servicePrincipalName = @("$clientID/$appDomain")
- $dtStart = [System.DateTime]::Now
- $dtEnd = $dtStart.AddYears(10)
- Connect-MsolService
- New-MsolServicePrincipal -ServicePrincipalNames $servicePrincipalName -AppPrincipalId $clientID -DisplayName $appName -Type Symmetric -Usage Verify -Value $newClientSecret -Addresses (New-MsolServicePrincipalAddresses -Address $appUrl) -StartDate $dtStart –EndDate $dtEnd
- New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Sign -Value $newClientSecret -StartDate $dtStart –EndDate $dtEnd
- New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Password -Usage Verify -Value $newClientSecret -StartDate $dtStart –EndDate $dtEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement