官术网_书友最值得收藏!

Scoping administrative roles

In the next step, we assign the user account administrator role. Verify available roles with the following cmdlet:

Get-AzureADDirectoryRoleTemplate

Now, we enable the user account administrator role with the following cmdlet:

Enable-AzureADDirectoryRole -RoleTemplateId fe930be7-5e62-47db-91af-98c3a49a38b1

Set variables and assign the user to the role:

$admins = Get-AzureADDirectoryRole
foreach($i in $admins) {
if($i.DisplayName -eq "User Account Administrator") {
$uaAdmin = $i
}
}

$HRUA = Get-AzureADUser -Filter "UserPrincipalName eq 'Don.Hall@$InitialDomain'"
$uaRoleMemberInfo = New-Object -TypeName Microsoft.Open.AzureAD.Model.RoleMemberInfo -Property @{ ObjectId = $HRUA.ObjectId }
Add-AzureADScopedRoleMembership -RoleObjectId $uaAdmin.ObjectId -ObjectId $HRAU.ObjectId -RoleMemberInfo $uaRoleMemberInfo

The output of the preceding command is as follows:

User Account Administrator assignment

Next, we will test our configuration.

主站蜘蛛池模板: 景洪市| 海盐县| 新郑市| 临朐县| 聂拉木县| 通许县| 边坝县| 花莲市| 双辽市| 穆棱市| 新化县| 泗洪县| 神木县| 通山县| 阳曲县| 东山县| 昭觉县| 溆浦县| 克什克腾旗| 东乡| 黔西县| 嘉定区| 塔城市| 湖北省| 林西县| 庐江县| 延川县| 阿拉善盟| 海口市| 榆中县| 达拉特旗| 胶州市| 扎囊县| 广昌县| 亳州市| 通许县| 莲花县| 平果县| 阆中市| 云浮市| 新兴县|