PowerShell Logo Small

Remove-ADGroup



This is the built-in help made by Microsoft for the command 'Remove-ADGroup', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Removes an Active Directory group.

SYNTAX


Remove-ADGroup [-Identity] <ADGroup> [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Partition <String>] [-Server <String>] [-Confirm] [-WhatIf]
[<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Remove-ADGroup cmdlet removes an Active Directory group object. You can use this cmdlet to remove security and distribution groups.


The Identity parameter specifies the Active Directory group to remove. You can identify a group by its distinguished name (DN), GUID, security identifier (SID), Security
Accounts Manager (SAM) account name, or canonical name. You can also set the Identity parameter to an object variable such as $<localADGroupObject>, or you can pass an
object through the pipeline to the Identity parameter. For example, you can use the Get-ADGroup cmdlet to retrieve a group object and then pass the object through the
pipeline to the Remove-ADGroup cmdlet.


If the ADGroup is being identified by its DN, the Partition parameter will be automatically determined.


For AD LDS environments, the Partition parameter must be specified except in the following two conditions:

-- The cmdlet is run from an Active Directory provider drive.
-- A default naming context or partition is defined for the AD LDS environment. To specify a default naming context for an AD LDS environment, set the
msDS-defaultNamingContext property of the Active Directory directory service agent (DSA) object (nTDSDSA) for the AD LDS instance.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=291088
Add-ADGroupMember
Get-ADGroup
Get-ADGroupMember
New-ADGroup
Remove-ADGroupMember
Set-ADGroup

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

PS C:\>Remove-ADGroup -Identity SanjaysReports
Confirm
Are you sure you want to perform this action?
Performing operation "Remove" on Target "CN=SanjayReports,DC=Fabrikam,DC=com".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):



This command removes the group that has samAccountName SanjaysReports.




-------------------------- EXAMPLE 2 --------------------------

PS C:\>Get-ADGroup -Filter 'Name -like "Sanjay*"' | Remove-ADGroup
Confirm
Are you sure you want to perform this action?
Performing operation "Remove" on Target "CN=SanjaysReports,DC=Fabrikam,DC=com".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):



This command gets all groups whose name starts with Sanjay and then remove them.