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

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.

主站蜘蛛池模板: 关岭| 蕲春县| 兴义市| 栖霞市| 鄂托克前旗| 敦化市| 眉山市| 迁安市| 虞城县| 灵寿县| 铅山县| 紫云| 庆元县| 商水县| 通江县| 城步| 扎兰屯市| 自治县| 慈利县| 微博| 安远县| 监利县| 翁源县| 巧家县| 丰台区| 屏东市| 阿拉尔市| 海宁市| 鄂尔多斯市| 桦川县| 永泰县| 永修县| 河北区| 政和县| 宝山区| 辽阳市| 普兰店市| 东辽县| 张北县| 澄迈县| 丹阳市|