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

Adding users to an administrative unit

Next, we add the users of the HR department to the HR [AU]. Use the following cmdlets to do this:

$HRAU = Get-AzureADAdministrativeUnit -Filter "displayname eq 'HR'"
$initialDomain = (Get-AzureADDomain)[0].Name
$HRUser1 = Get-AzureADUser -Filter "UserPrincipalName eq 'don.hall@$InitialDomain'"
$HRUser2 = Get-AzureADUser -Filter "UserPrincipalName eq 'ellen.adams@$InitialDomain'"
Add-AzureADAdministrativeUnitMember -ObjectId $HRAU.ObjectId -RefObjectId $HRUser1.ObjectId
Add-AzureADAdministrativeUnitMember -ObjectId $HRAU.ObjectId -RefObjectId $HRUser2.ObjectId
Get-AzureADAdministrativeUnitMember -ObjectId $HRAU.ObjectId | Get-AzureADUser

The output of the preceding command is as follows:

Newly added users overview

Next, we will use the scoping options.

主站蜘蛛池模板: 焉耆| 额济纳旗| 静安区| 昂仁县| 庆云县| 阿瓦提县| 安岳县| 高碑店市| 沽源县| 南江县| 乳山市| 麦盖提县| 陈巴尔虎旗| 临沭县| 乌鲁木齐市| 红原县| 五台县| 临颍县| 嘉定区| 巧家县| 临漳县| 英山县| 和政县| 吉安县| 淄博市| 奉贤区| 金华市| 兴海县| 安溪县| 安福县| 台中县| 吴桥县| 本溪市| 师宗县| 阜新市| 普陀区| 平和县| 武隆县| 昌邑市| 涟水县| 新疆|