Last active
January 9, 2019 12:13
-
-
Save nicolonsky/becf40be21d4bdaf5c6f262df5a3d35c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connect-AzureAD | |
$runAsAccountServicePrincipal = Get-AzureADServicePrincipal -ObjectId "497421d0-5b78-4cf1-bab1-6ad2e3d7f319" | |
$accountAdminDirectoryRole= Get-AzureADDirectoryRole | where-object {$_.DisplayName -eq "User Account Administrator"} | |
Add-AzureADDirectoryRoleMember -ObjectId $accountAdminDirectoryRole.ObjectId ` | |
-RefObjectId $runAsAccountServicePrincipal.ObjectId | |
Get-AzureADDirectoryRoleMember -ObjectId $accountAdminDirectoryRole.ObjectId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment