DFS-R Commands, Initial Sync and Membership

Hello all together,

I want to show you commands, that I must try to find every time. I will help you to have this useful commands without searching on the web.

Content:

1. Start the Initial Sync, set the primary member

2. Check the Membership status

3. Check synchronization state

 

Start the Initial Sync, set the primary member

 

First of all, you have configured your DFS Folder Targets on two servers and prepared the replication group, but it can happen that no synchronization begins.
That could happen when no server was set as primary (in replication wizard is a bug, that will not set the primary member).
In this case, you need to set it manually (in cmd).

dfsradmin Membership Set /RGName:<Replication Group Name> /RFName:<Replication Folder> /MemName:<Primary Server> /IsPrimary:True

Example:

dfsradmin Membership Set /RGName:contonso.com/DFS/Share001 /RFName:TestFolder /MemName:MyServer1 /IsPrimary:True

Output:

Command completed successfully.

 

 

Check Membership Status

 

This command is very useful for the Initial Sync. You can see which server was set to primary, and when there is no one set, you can use the command above.
I use this command to see if the Initial Sync will go forward.

Dfsradmin Membership List /RGname:<Replication Group Name> /attr:MemName,RFName,IsPrimary

Example:

Dfsradmin Membership List /RGname:contonso.com/DFS/Share001 /attr:MemName,RFName,IsPrimary

Example Output:

MemName      RfName    IsPrimary
MyServer1    Share001  Yes
MyServer2    Share001  No

 

Check synchronization state

 

Last but not least, you also want to see the state of the synchronization. I search a long time for it and now I will share it to you (before you also look for it a lot of time).
With this Powershell command you see the state of all Replicated Folders. I prefer to not use it on the primary server.
Command:

Get-WmiObject -Namespace root\microsoftdfs -Class dfsrreplicatedfolderinfo|Select State,ReplicatedFolderName

Example Output:

State ReplicatedFolderName
----- --------------------
    4 Share001
    4 ShareAlpha
    4 ShareOmega
    2 ShareMega
    2 ShareAll
    4 Share002

Sync State:

State Description
0 Uninitialized
1 Initialized
2 Initial Sync
3 Auto Recovery
4 Normal
5 In Error

 

I hope you find this little information useful. If you want you can leave a command, or not.

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.