Add-DfsrMember
Add-DfsrMember
Adds computers to a replication group.
Sintassi
Parameter Set: Default
Add-DfsrMember [-GroupName] <String[]> [-ComputerName] <String[]> [[-Description] <String> ] [[-DomainName] <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Descrizione dettagliata
The Add-DfsrMember cmdlet adds computers to a replication group as members. Members of a replication group host replicated folders. You can specify a description for member computers. Use the Remove-DfsrMember cmdlet to remove members of a replication group.
Parametri
-ComputerName<String[]>
Specifies an array of names of computers. The cmdlet adds these computers to the replication group specified by the GroupName parameter. You can use a comma separated list and the wildcard character (*).
Alias |
MemberList,MemList |
Obbligatorio? |
true |
Posizione? |
2 |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
True (ByPropertyName) |
Accetta caratteri jolly? |
false |
-Description<String>
Specifies a description for a member computer.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
3 |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
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.
Alias |
nessuno |
Obbligatorio? |
false |
Posizione? |
101 |
Valore predefinito |
[Current Domain] |
Accetta input da pipeline? |
True (ByPropertyName) |
Accetta caratteri jolly? |
false |
-GroupName<String[]>
Specifies an array of names of replication groups. You can use a comma separated list and the wildcard character (*).
Alias |
RG,RgName |
Obbligatorio? |
true |
Posizione? |
1 |
Valore predefinito |
nessuno |
Accetta input da pipeline? |
True (ByValue, ByPropertyName) |
Accetta caratteri jolly? |
false |
-Confirm
Richiede conferma prima di eseguire il cmdlet.
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
False |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
-WhatIf
Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.
Obbligatorio? |
false |
Posizione? |
named |
Valore predefinito |
False |
Accetta input da pipeline? |
false |
Accetta caratteri jolly? |
false |
<CommonParameters>
Questo cmdlet supporta i parametri comuni: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Per altre informazioni, vedere about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Input
Il tipo di input è il tipo degli oggetti che è possibile reindirizzare al cmdlet.
- Microsoft.DistributedFileSystemReplication.DfsReplicationGroup
Output
Il tipo di output corrisponde al tipo di oggetti generati dal cmdlet.
- Microsoft.DistributedFileSystemReplication.DfsrMember
Esempi
Example 1: Add a member to a replication group
This command adds the computer named SRV07 to replication group named RG01. The console displays the new DfsrMember object.
PS C:\> Add-DfsrMember -GroupName "RG01" -ComputerName "SRV07"
Example 2: Add multiple members to a new 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 by using the Set-DfsrMembership cmdlet. 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