Set-DfsrMembership
Set-DfsrMembership
Configures membership settings for replication group members.
Syntax
Parameter Set: Default
Set-DfsrMembership [-GroupName] <String[]> [-FolderName] <String[]> [-ComputerName] <String[]> [[-ContentPath] <String> ] [[-PrimaryMember] <Boolean> ] [[-StagingPath] <String> ] [[-StagingPathQuotaInMB] <UInt32> ] [[-ConflictAndDeletedQuotaInMB] <UInt32> ] [[-ReadOnly] <Boolean> ] [[-RemoveDeletedFiles] <Boolean> ] [[-DisableMembership] <Boolean> ] [[-MinimumFileStagingSize] <FileStagingSize> ] [[-DfsnPath] <String> ] [[-DomainName] <String> ] [-Force] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Set-DfsrMembership cmdlet configures membership settings for Distributed File System (DFS) Replication group members. Members of a replication group host replicated folders. Use the Add-DfsrMember cmdlet to add a member to a group. Adding a member creates a membership that contains default values. After you add a member, you can use the current cmdlet to modify membership settings.
Use this cmdlet to specify the name and location of a replicated folder and whether a replicated folder is read-only. You can specify a member computer as the primary member of its group.
You can also specify how much disk space the member computer allocates for its ConflictsAndDeleted folder and whether to copy deleted replicated files to that folder. You can specify a staging folder and its maximum size and the smallest file that DSF Replication stages during outbound replication.
You can disable replication for a member computer by using this cmdlet, but to pause replication, disable the connections by using the Remove-DfsrConnection cmdlet on the member or use the Suspend-DfsReplicationGroup cmdlet.
Parameters
-ComputerName<String[]>
Specifies an array of names of member computers. The cmdlet modifies membership settings for these member computers. You can use a comma separated list and the wildcard character (*).
Aliases |
MemberList,MemList |
Required? |
true |
Position? |
3 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-ConflictAndDeletedQuotaInMB<UInt32>
Specifies the maximum size, in megabytes, for the ConflictsAndDeleted folder. The default value is 4096 MB.
When the size of this folder reaches a specified percent of the quota value, DFS Replication deletes the oldest files in the folder. The default value is 90 percent. DFS Replication continues to delete files until the size of the folder reaches a specified percent of the quota value. The default value is 60 percent. Use the Set-DfsrServiceConfiguration cmdlet to modify the percent values.
Aliases |
none |
Required? |
false |
Position? |
8 |
Default Value |
660 |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ContentPath<String>
Specifies a local folder to contain replicated files associated with the replicated folder specified by using the FolderName parameter.
Aliases |
none |
Required? |
false |
Position? |
4 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DfsnPath<String>
Specifies the DFS Namespace (DFSN) folder path of the membership. You can use this value to keep track of the DFSN folder path. This value does not affect replication.
Aliases |
none |
Required? |
false |
Position? |
13 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DisableMembership<Boolean>
Indicates whether to disable the membership for a replication folder in a replication group.
If you disable membership, DFS Replication stops replicating content on this computer, but does not delete the replicated folder or its private replication data. If you re-enable membership, you will lose any private data and can lose replicated data. You may be able to recover replicated data by using the Restore-DfsrPreservedFiles cmdlet. By default, memberships are enabled.
If you want to temporarily pause replication, disable the connections on the member by using the Set-DfsrConnection cmdlet or use the Suspend-DfsReplicationGroup cmdlet.
Aliases |
none |
Required? |
false |
Position? |
11 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-DomainName<String>
Specifies the NetBIOS name or fully qualified domain name (FQDN) for the Active Directory Domain Service (AD DS) domain that contains the replication group. If you do not specify this parameter, the cmdlet uses the domain of the current user.
Aliases |
none |
Required? |
false |
Position? |
101 |
Default Value |
[Current Domain] |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-FolderName<String[]>
Specifies an array of names of replicated folders. If you do not specify this parameter, the cmdlet applies to all participating replicated folders. You can use a comma separated list and the wildcard character (*).
Aliases |
RF,RfName |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
True (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Force
Forces the command to run without asking for user confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-GroupName<String[]>
Specifies an array of names of replication groups. If you do not specify this parameter, the cmdlet applies to all participating replication groups. You can use a comma separated list and the wildcard character (*).
Aliases |
RG,RgName |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue, ByPropertyName) |
Accept Wildcard Characters? |
false |
-MinimumFileStagingSize<FileStagingSize>
Specifies the minimum file size that DFS Replication stages during outbound replication. By default, this value is 256 KB. If you also disable Remote Differential Compression (RDC), files smaller than this size replicate without staging. On high-bandwidth, low-latency networks like LANs and high-speed WANs, this typically results in faster replication, at the cost of higher bandwidth saturation. You can use the Set-DfsrConnection cmdlet to disable or enable RDC.
Windows ServerĀ® 2012 and previous versions of the Windows operating system do not support the file size setting. Previous versions of the Windows operating system that support DFS Replication use a hard-coded 256 KB minimum staging size.
The acceptable values for this parameter are:
-- Size256KB (0)
-- Size512KB (1)
-- Size1MB (2)
-- Size2MB (3)
-- Size4MB (4)
-- Size8MB (5)
-- Size16MB (6)
-- Size32MB (7)
-- Size64MB (8)
-- Size128MB (9)
-- Size256MB (10)
-- Size512MB (11)
-- Size1GB (12)
-- Size2GB (13)
-- Size4GB (14)
-- Size8GB (15)
-- Size16GB (16)
-- Size32GB (17)
-- Size64GB (18)
-- Size128GB (19)
-- Size256GB (20)
-- Size512GB (21)
-- Size1TB (22)
-- Size2TB (23)
-- Size4TB (24)
-- Size8TB (25)
-- Size16TB (26)
-- Size32TB (27)
-- Size64TB (28)
-- Size128TB (29)
-- Size256TB (30)
-- Size512TB (31)
Aliases |
none |
Required? |
false |
Position? |
12 |
Default Value |
256KB |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PrimaryMember<Boolean>
Indicates whether this member computer is the primary member of a group. Specify one and only one membership in each replication group as primary. By default, members are not primary.
If you specify a value of $True for this parameter, do not specify a value of $True for the ReadOnly parameter.
Aliases |
none |
Required? |
false |
Position? |
5 |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-ReadOnly<Boolean>
Indicates whether a replicated folder is read-only. By default, memberships are read/write.
If you change a read/write folder to read-only or change a read-only folder to read/write, DFS Replication moves any local unreplicated changes to the ConflictAndDeleted folder. You may be able to restore these changes by using the Restore-DfsrPreservedFiles cmdlet.
If you specify a value of $True for this parameter, do not specify a value of $True for the PrimaryMember parameter.
Aliases |
none |
Required? |
false |
Position? |
9 |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-RemoveDeletedFiles<Boolean>
Indicates whether the member computer deletes files and folders immediately following inbound replication. If this parameter has a value of $False, the member moves deleted files and folders to the ConflictAndDeleted folder when the deletion replicates inbound. The originating server always deletes files without preservation. You can use the Restore-DfsrPreservedFiles cmdlet to restore deleted files while they still exist in the ConflictAndDeleted folder. If this parameter has a value of $True, when a replicating member replicates a deletion, it deletes the local copy of the file immediately. If you do not specify this parameter, by default, DFS Replication preserves deleted files.
Aliases |
none |
Required? |
false |
Position? |
10 |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-StagingPath<String>
Specifies a local folder for staging content. If you do not specify this parameter, DFS Replication creates a folder named <replicated folder>\DfsrPrivate\Staging.
Aliases |
none |
Required? |
false |
Position? |
6 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-StagingPathQuotaInMB<UInt32>
Specifies the maximum size, in megabytes, of a staging folder. Memberships have a default value is 4096 MB. When the size of this folder reaches a specified percent, by default, 90, of the quota value, DFS Replication deletes the oldest files in the folder. DFS Replication continues to delete files until the size of the folder reaches a specified percent, by default, 60, of the quota value. Use the Set-DfsrServiceConfiguration cmdlet to modify the percent values.
If you choose a larger quota, the member computer keeps staged data for longer periods, which provides better replication performance.
Aliases |
none |
Required? |
false |
Position? |
7 |
Default Value |
4096 |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Confirm
Prompts you for confirmation before running the cmdlet.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? |
false |
Position? |
named |
Default Value |
false |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
- Microsoft.DistributedFileSystemReplication.DfsReplicationGroup, Microsoft.DistributedFileSystemReplication.DfsReplicatedFolder, string
Outputs
The output type is the type of the objects that the cmdlet emits.
- Microsoft.DistributedFileSystemReplication.DfsrMembership
Examples
Example 1: Change membership settings
This command changes settings for a replication folder on a computer named SRV07 that belongs to a group named RG22. The command sets the staging folder quota to 32768 MB and the ConflictAndDeleted folder quota to 4096 MB. The console displays the membership object, which includes the new values for the settings.
PS C:\> Set-DfsrMembership -GroupName "RG22" -FolderName "RepFolder" -ComputerName "SRV07" -StagingPathQuotaInMB 32768 -ConflictAndDeletedQuotaInMB 4096
Example 2: Create a replication group
This example sets up a replication group called River Branch Office. The group consists of three computers, a primary member named SRV01 and two other computers named SRV02 and SRV03. The example specifies a replication folder and establishes connections between the members. The example also specifies the maximum size of the staging folder.
Each command returns the appropriate object or objects. This example uses the Format-Table cmdlet to format output in the console. For more information, type Get-Help Format-Table
.
The first command creates a replication group, specifies a replicated folder, and adds three computers to the group as members. The command creates a replication group named River Branch Office by using the New-DfsReplicationGroup cmdlet. The command passes the new group to the New-DfsReplicatedFolder cmdlet by using the pipeline operator. That cmdlet creates a replicated folder named Data Distribution 01. The command adds three computers, named SRV01, SRV02, and SRV03, to the new replication group.
PS C:\> New-DfsReplicationGroup -GroupName "River Branch Office" | New-DfsReplicatedFolder -FolderName "Data Distribution 01" | Add-DfsrMember -ComputerName "SRV01","SRV02","SRV03" | Format-Table dnsname,groupname -auto -wrap
The second command adds a connection between the source computer named SRV01 and the destination computer named SRV02 by using the Add-DfsrConnection cmdlet.
PS C:\> Add-DfsrConnection -GroupName "River Branch Office" -SourceComputerName "SRV01" -DestinationComputerName "SRV02" | Format-Table *name -wrap -auto
The third command adds a connection between the source computer named SRV01 and the destination computer named SRV03.
PS C:\> Add-DfsrConnection -GroupName "River Branch Office" -SourceComputerName "SRV01" -DestinationComputerName "SRV03" | Format-Table *name -wrap -auto
The fourth command makes the computer named SRV01 the primary member of the group. The command also specifies Data Distribution 01 as the name of the replicated folder in the location C:\RF01. The command specifies the staging folder quota as 16384 MB. The command includes the Force parameter, and, therefore, does not prompt the user for confirmation.
PS C:\> Set-DfsrMembership -GroupName "River Branch Office" -FolderName "Data Distribution 01" -ContentPath "C:\RF01" -ComputerName "SRV01" -PrimaryMember $True -StagingPathQuotaInMB 16384 -Force | Format-Table *name,*path,primary* -auto -wrap
The fifth command modifies values for the computers named SRV02 and SRV03. The command specifies Data Distribution 01 as the name of the replicated folder in the location C:\RF01. The command specifies the staging folder quota as 16384 MB. The command includes the Force parameter, and, therefore, does not prompt the user for confirmation.
Unlike the previous command, this command does not specify a value of the PrimaryMember parameter. The computers named SRV02 and SRV03 have the default value of $False for the setting.
PS C:\> Set-DfsrMembership -GroupName "River Branch Office" -FolderName "Data Distribution 1" -ContentPath "C:\RF01" -ComputerName "SRV02","SRV03" -StagingPathQuotaInMB 16384 -Force | Format-Table *name,*path,primary* -auto -wrap