DFS Replication State Codes

Sometimes it is really important to know health status of all replication groups. If there is any problem in the DFS replication, this is the first step to perform to check the state of replication groups of each server.

Lets say, you have two file servers in your office, FS001 and FS002 and has many DFS replication groups in your DFS management. On a particular group, files and folders are replication from FS001 to FS002, but not replicating from FS002 to FS001. It seems that there is some problem with the replication from FS002 to FS001. Best way is to run the below mentioned command on both servers.

Get-WmiObject -Namespace "root\microsoftdfs" -Class dfsrreplicatedfolderinfo -ComputerName "YourServerName" | Select-Object -Property PSComputerName, Replicationgroupname, Replicatedfoldername, State
(Don't use quotes when you put your server name, just type server name like FS001.)
This command will give you information about all replication groups with their folder names and their state.

State codes are as follow:
0: Uninitialized
1: Initialized
2: Initial Sync
3: Auto Recovery
4: Normal
5: In Error


For every administrator, it is important to keep their replication groups in state 4. If any replication group is in state 2 or 3, please wait and see after some time if backlogs are decreasing or not and changes the state to 4. If it doesn't happen, it simply means that there is something wrong with the replication group and it requires some troubleshooting to fix it. If it is state 5, it need to be fixed.

You can create a power shell script which will sent you this information every day in morning or when ever you want.
I have already created a script and scheduled it for me which sent me an email all replication groups which has state 2, 3 and 5 of all servers every alternate day. If you need the script please let me know.

17 comments:

  1. Hi Ashish, I know this is very old blog but do you still have that powershell script and if yes, can you please send it to me at shaibaz.711@gmail.com

    ReplyDelete
  2. I will check it and share it on your email id. If i will not find it, then i will create a one for you.

    ReplyDelete
  3. please share the scripts with me

    ReplyDelete
  4. Would you consider sharing that script with me as well? tgolbeck@gmail.com
    Thank you!

    ReplyDelete
  5. Hi. Can you please share the script to vignesanand@Outlook.com? Thank you in advance.

    ReplyDelete
  6. can you make the script public?

    ReplyDelete
  7. Hello, could you please share

    ReplyDelete
  8. Hi Ashish, could you please share the script with me?

    ReplyDelete
  9. Hi, I'm also interested by your script if you provided to me as well?
    Thanks

    ReplyDelete
  10. Hi, I also want that script. Can you make that Public? Or Send me per Mail?
    Thanks

    ReplyDelete
  11. Please share the script with me
    Romainnaude@gmail.com

    Thanks

    ReplyDelete
  12. I'd also like a copy of that script if it's still available please.

    ReplyDelete
  13. Hello asish Can u share me the script

    ReplyDelete
  14. Hi there. Can I also have the script please. Merci!!

    ReplyDelete
  15. Please share the script with me
    ohmamata@gmail.com

    Thanks

    ReplyDelete
  16. could i please get the script
    greg.colucci@bldr.com

    ReplyDelete
  17. please can you share the script with me abdelazizelbizri@hotmail.com

    ReplyDelete