Quickpost – Use Powershell to get DFS-R initial replication status

by

·

Hi all,

because I didn’t found this in the first sight, and had to use a wmic query, I have prepared my Powershell command:
Get-WmiObject -Namespace root\microsoftdfs -Class dfsrreplicatedfolderinfo | Select-Object ReplicatedFolderName,State

The State 2 indicates, that the replication is not done yet, but a 4 would indicate that the initial replication is done.

See this website for the class explanation:
https://msdn.microsoft.com/en-us/library/bb540019(v=vs.85).aspx

Possible states are:
Uninitialized (0)
Initialized (1)
Initial Sync (2)
Auto Recovery (3)
Normal (4)
In Error (5)

If you only want to get all replications with a specific status, use the following command:
Get-WmiObject -Namespace root\microsoftdfs -Class dfsrreplicatedfolderinfo -Filter 'state=2' | Select-Object replicationgroupname,replicatedfoldername

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *