DFS replication status

As part of the troubleshooting process, we need to verify the DFS replication status. The status of the DFS replication can be determined based on the status code.

Status codes for DFS are as follows:

  • 0: Uninitialized
  • 1: Initialized
  • 2: Initial synchronization
  • 3: Auto recovery
  • 4: Normal
  • 5: In error state
  • 6: Disabled
  • 7: Unknown

In order to review the status, we can use the following command:

For /f %r IN ('dsquery server -o rdn') do @echo %i && @wmic /node:"%r" /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo WHERE replicatedfoldername='SYSVOL share' get replicatedfoldername,state

Get Mastering Active Directory now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.