Muokkaa

Jaa


Remove-MsolAdministrativeUnitMember

Removes a member from an administrative unit.

Syntax

Remove-MsolAdministrativeUnitMember
      -AdministrativeUnitObjectId <Guid>
      [-AdministrativeUnitMemberObjectId <Guid>]
      [-TenantId <Guid>]
      [<CommonParameters>]

Description

The Remove-MsolAdministrativeUnitMember cmdlet is used to remove a member from an administrative unit.

Examples

Example 1: Remove a member from an administrative unit

PS C:\> $AdministrativeUnit = Get-MsolAdministrativeUnit -SearchString "West Coast"
PS C:\> $User = Get-MsolUser -UserPrincipalName "davidchew@contoso.com"
PS C:\> Remove-MsolAdministrativeUnitMember  -AdministrativeUnitObjectId $AdministrativeUnit.ObjectId -AdministrativeUnitMemberObjectId $User.ObjectId

The first command gets an administrative unit that matches a search string by using the Get-MsolAdministrativeUnit cmdlet. The command stores the administrative unit in the $AdministrativeUnit variable.

The second command gets a user for the user principal name davidchew@contoso.com by using the Get-MsolUser cmdlet. The command stores the user in the $User variable.

The final command removes the member in $User from the administrative unit in $AdministrativeUnit.

Parameters

-AdministrativeUnitMemberObjectId

Specifies the unique object ID of the member to remove from the administrative unit.

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

-AdministrativeUnitObjectId

Specifies the unique object ID of the administrative unit on which this cmdlet operates.

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

-TenantId

Specifies the unique ID of the tenant on which to perform the operation. The default value is the tenant of the current user. This parameter applies only to partner users.

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