Remove-MsolAdministrativeUnit

Deletes an administrative unit from Azure Active Directory.

Syntax

Remove-MsolAdministrativeUnit
      -ObjectId <Guid>
      [-Force]
      [-TenantId <Guid>]
      [<CommonParameters>]

Description

The Remove-MsolAdministrativeUnit cmdlet deletes an administrative unit from Azure Active Directory.

Examples

Example 1: Remove an administrative unit

PS C:\> $AdministrativeUnit = Get-MsolAdministrativeUnit -SearchString "West Coast"
PS C:\> Remove-MsolAdministrativeUnit -ObjectId $AdministrativeUnit.ObjectId -Force

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 deletes the administrative unit. The command specifies the administrative unit by using the object ID of $AdministrativeUnit. The command specifies the Force parameter. It does not prompt for comfirmation.

Parameters

-Force

Indicates that this cmdlet does not prompt you for confirmation.

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

-ObjectId

Specifies the unique ID of the administrative unit to remove.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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