Remove-DfsReplicationGroup

Removes a replication group.

Syntax

Remove-DfsReplicationGroup
      [-GroupName] <String[]>
      [-RemoveReplicatedFolders]
      [-Force]
      [[-DomainName] <String>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-DfsReplicationGroup cmdlet removes a replication group.

When you remove a replication group, you remove the group from Active Directory, and you also delete all associated aspects of the Distributed File System (DFS) Replication topology for that replication group, such as members, memberships, and connections. All replication halts on all members. This operation does not delete any replicated file data or private data. Use this command only when you decommission a replication group.

Examples

Example 1: Remove a replication group

PS C:\> Remove-DfsReplicationGroup -GroupName "RG01"
Performing this operation will remove the replication group "RG01" and the subscriptions members have to this
replication group. Are you sure you want to continue to remove this replication group? [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y

This command removes the replication group named RG01 from the current domain.

Example 2: Remove replication groups using a wildcard

PS C:\> Remove-DfsReplicationGroup -GroupName "RG*" -RemoveReplicatedFolders -Domain "corp.contoso.com"
Performing this operation will remove the replication group "RG01" and the subscriptions members have to this
replication group. Are you sure you want to continue to remove this replication group? [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

Performing this operation will remove the replication group "RG02" and the subscriptions members have to this
replication group. Are you sure you want to continue to remove this replication group? [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

Performing this operation will remove the replication group "RG03" and the subscriptions members have to this
replication group. Are you sure you want to continue to remove this replication group? [Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

This command removes all replication groups that include the pattern RG* in domain corp.contoso.com, even if the groups include replicated folders.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-DomainName

Specifies the NetBIOS name or fully qualified domain name (FQDN) for the Active Directory Domain Service (AD DS) domain that contains a replication group.. If you do not specify this parameter, the cmdlet uses the current domain.

Type:String
Position:100
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation. Use this parameter for scripted removal of replication groups.

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

-GroupName

Specifies an array of names of replication groups. You can use a comma separated list and the wildcard character (*).

If the replication group contains any replicated folders, you must specify the RemoveReplicatedFolders switch parameter.

Type:String[]
Aliases:RG, RgName
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-RemoveReplicatedFolders

Indicates that the cmdlet removes any replicated folders belonging to the replication group prior to deleting the replication group.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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

Inputs

Microsoft.DistributedFileSystemReplication.DfsReplicationGroup

Outputs

[none]