Advertisement
Guest User

Untitled

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