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
Position:Named
Default value:None
Accept pipeline input: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)

-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
Accept pipeline input:True (ByPropertyName)