Add-AzureADMSScopedRoleMembership

Adds a scoped role membership to an administrative unit.

Syntax

Add-AzureADMSScopedRoleMembership
   -Id <String>
   [-AdministrativeUnitId <String>]
   [-RoleId <String>]
   [-RoleMemberInfo <MsRoleMemberInfo>]
   [<CommonParameters>]

Description

The Add-AzureADMSScopedRoleMembership cmdlet adds a scoped role membership to an administrative unit.

Examples

Example 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

This cmdlet returns the Scoped role membership object.

Parameters

-AdministrativeUnitId

{{ Fill AdministrativeUnitId Description }}

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

Specifies the ID of an admininstrative unit.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RoleId

{{ Fill RoleId Description }}

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RoleMemberInfo

Specifies a RoleMemberInfo object.

Type:MsRoleMemberInfo
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False