Add-AzureADMSScopedRoleMembership
將限定範圍的角色成員資格新增至管理單位。
語法
Add-AzureADMSScopedRoleMembership
-Id <String>
[-AdministrativeUnitId <String>]
[-RoleId <String>]
[-RoleMemberInfo <MsRoleMemberInfo>]
[<CommonParameters>]
Description
Add-AzureADMSScopedRoleMembership Cmdlet 會將範圍角色成員資格新增至管理單位。
範例
範例 1
$User = Get-AzureADUser -SearchString "The user that will be an admin on this unit"
$Role = Get-AzureADDirectoryRole | Where-Object -Property DisplayName -Eq -Value "User Account Administrator"
$Unit = Get-AzureADMSAdministrativeUnit | Where-Object -Property DisplayName -Eq -Value "The display name of the unit"
$RoleMember = New-Object -TypeName Microsoft.Open.MSGraph.Model.MsRolememberinfo.RoleMemberInfo
$RoleMember.Id = $User.ObjectID
Add-AzureADMSScopedRoleMembership -Id $Unit.Id -RoleId $Role.ObjectId -RoleMemberInfo $RoleMember
此 Cmdlet 會傳回 Scoped 角色成員資格物件。
參數
-AdministrativeUnitId
{{ Fill AdministrativeUnitId Description }}
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Id
指定系統管理員單元的識別碼。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-RoleId
{{ Fill RoleId Description }}
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-RoleMemberInfo
指定 RoleMemberInfo 物件。
類型: | MsRoleMemberInfo |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |