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

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.

主站蜘蛛池模板: 吉木萨尔县| 怀化市| 丰台区| 海宁市| 高陵县| 上饶市| 永福县| 仁布县| 青河县| 文水县| 麻城市| 桂阳县| 涪陵区| 轮台县| 阆中市| 资源县| 新源县| 荣成市| 河津市| 平和县| 安岳县| 和顺县| 安泽县| 邵阳县| 松江区| 囊谦县| 武强县| 乌拉特前旗| 伊宁市| 常州市| 庄河市| 龙海市| 思南县| 卓尼县| 安陆市| 湖口县| 武鸣县| 信宜市| 穆棱市| 基隆市| 抚松县|