Remove-MsolGroup

Removes a group from Azure Active Directory.

Syntax

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

Description

The Remove-MsolGroup cmdlet deletes a group from Azure Active Directory.

Examples

Example 1: Remove a security group

PS C:\> $GroupId = Get-MsolGroup -SearchString "MyGroup"
PS C:\> Remove-MsolGroup -objectid $GroupId

The first command gets the security group that matches the string MyGroup, and then stores it in the $GroupId variable. The second command removes the group in $GroupId.

Parameters

-Force

Indicates that this cmdlet does not prompt you for confirmation.

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

Specifies the unique object ID of the group to remove.

Type:Guid
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False