Author: NetworkAdminKB.com

Created: 2011-07-01

Modified: 2011-08-01

 

Version: 1.4.9

The DFSRCheck utility can be used to do all of the following on Windows 2003 R2 and 2008 R2 DFS-R implementations. 

1)      Create HTML, CSV, or TSV reports on the following.

a.       Report on the status the DFS-R Service of a DFS-R server and its partners.

                                                               i.      The DFS-R Service is the executable responsible for DFS-R

                                                             ii.      You can filter the report by the state of the service  (/service option)

b.      Report on the status the DFS-R Group members for all Replication Groups host on a DFS-R server and its partners.

                                                               i.      Replication Groups contain information on which servers are members of which replication groups.

                                                             ii.      You can filter the report by the state of the Replication Group. (/member option)

c.       Report on the status of all DFS-R Folders of a DFS-R server and its partners.

                                                               i.      A Replicated Folder is a subset of a Replication Group.

                                                             ii.      You can filter the report by the state of the Replicated Folder. (/folder option)

d.      Report on the status of all DFS-R Connections between a DFS-R server and its partners.

                                                               i.      DFS-R Connections are used to replicate the data of the Replication Groups/Folders.

                                                             ii.      You can filter the report by the state of the Replication Connection. (/conn option)

e.       Report on the status of all DFS-R Synchronization sessions between a DFS-R server and its partners.

                                                               i.      Synchronization sessions are how the data is replicated either on a schedule or manually.

                                                             ii.      You can filter the report by the state of the Synchronization Session. (/sync option)

f.        Report on the Backlog file counts of all DFS-R Synchronization sessions.

                                                               i.      You can filter the report based on the number of backlog files > ###  (/backlog option)

g.       Report on a multiple DFS-R servers and their partners.

                                                               i.      In highly complex environments you may want a single report for all DFS-R servers.  Using the /i=inputfile syntax you can report on multiple servers with a single report.

h.       Report on a single DFS-R server and it partners.

                                                               i.      You may want to only monitor one specific DFS-R server and the partners it replicates with.  Using the /s=server syntax you can.

2)      Run multiple reports without needing to contact the servers again.

a.       After the first run of DFSRCheck most information is stored in a database file (db1.mdb by default).  By using the report (/r) syntax you can run multiple follow up reports quickly.

                                                               i.      For example:  By default all reports are filtered to report on only potential problems, normal states are not reported.  You can quickly produce a second report for all states (normal and abnormal) using the /r syntax in two simple commands.

 

Dfscheck /s=server1 /backlog=500

Dfscheck /r /service=3210 /sync=6543210 /conn=3210 /member=210 /folder=543210 /backlog=0

 

                                                             ii.      While the first report may take a several minutes to complete, the second report will run is seconds.

                                                            iii.      Note: Because it is time consuming, reporting on backlog information is optional.  Thus you specify the /backlog switch in the first DFSRCheck execution to be able to report on backlog using the (/r) syntax in the second running of the DFSRCheck command

3)      Post the reports to a Web Server or send them via an Email.

a.       Run the DFSRCheck command from any web server and use the /o=path\file command to post the results on the webserver.

b.      With a simple batch file and email utility you can send the report via SMTP Email as needed.

 

Requirements and Limitations

1)      DFSRCheck requires the DFS-R WMI implementation (aka: MicrosoftDfs Namespace) be available on all servers it may communicate with.

2)      By default a Microsoft Access database file called db1.mdb is require for use by the DFSRCheck application. 

a.       By default, the file db1.mdb is provided with the DFSRCheck download.  You should keep a backup copy of this empty MDB file just in case the current MDB file becomes corrupted.

b.      Any MDB file can be used and stored in any location by specifying the /db=path\file option.

3)      Simultaneous executions of DFSRCheck to the same MDB file using the /s or /i syntax are not support.

a.       DFSRCheck deletes the old data in the MDB file on startup.

b.      To run multiple copies of DFSRCheck at the same time, specify different MDB files using the /db=path\file option.

4)      Permissions required

a.       To run DFSRCheck with /s or /i options the user account must have access to the MicrosoftDfs Namespace via WMI on each server.

b.      Permissions to read and write to the MDB file will be required.

c.       In general the user running the DFSRCheck utility should be a local Administrator on each server or have Domain Admin permissions.

5)      Runtime and WAN considerations.

a.       Obtaining the Backlog is the most time consuming activity, especially if the severs are across a WAN.

b.      The run time needed to gather the DFS-R information may vary by the available bandwidth of any WAN connections between servers.

6)      VB6 Runtime may be required on Windows 2000 or earlier OS.

 

Testing a Development

This was tested and developed against 50+ Windows 2008 R2 servers running DFS-R and maintaining over 200 Replication Groups, and over 400 connections.  While the same DFS-R WMI specification is used on Windows 2003 R2 as in Windows 2008 R2 this utility is untested on Windows 2003 R2 DFS-R implementations.  The average run time when collecting backlog information is about 15-20 minutes.

 

 

Syntax:

DFSRCheck

 {/s=server | /i=inputfile | /r}

 [/service=3210] [/sync=6543210] [/conn=3210] [/member=210] [/folder=543210]

 [/backlog=#] [db=path\file.mdb] [/o=path\file.ext] [/f=csv,tsv,html]

 

Purpose: Peform various health checks of the DFS-R environment on the specified

           server(s) and their immediate partners.

 

Select between individual server (/s), multiple servers (/i), or report (/r).

 

/s=server      Specify an individual server name or ip address.

/i=InputFile   Specify an inputfile of server names or ip addresses.

/r             Report only using existing MDB file information.

                 Do not gather new DSF-R health information.

 

Change Report Defaults:

  If a report type is omitted the report is run with default settings.

  Specify each number only once, zero (0) must never be the first number,

  unless zero (0) is the only number.

/service=3210  Report on Service Status

                 3 = Shutting Down

                 2 = Degraded

                 1 = Running

                 0 = Starting

                 Default value = 320 (service is not running)

/sync=6543210  Report on Sync Status

                 6 = In Error

                 5 = Interrupted

                 4 = In Sync

                 3 = Completed

                 2 = In Progress

                 1 = Connecting

                 0 = Initialized

                 Default value = 6510 (not in sync, completed, or in progress)

/conn=3210     Report on Connection Status

                 3 = In Error

                 2 = Offline

                 1 = Online

                 0 = Connecting

                 Default value = 320 (not online)

/member=210    Report on Member Status

                 2 = In Error

                 1 = Shutting Down

                 0 = Initialized

                 Default value = 21 (not initialized)

/folder=543210 Report on Folder Status

                 5 = In Error

                 4 = Normal

                 3 = Auto Recovery

                 2 = Initial Sync

                 1 = Initialized

                 0 = Uninitialized

                 Default value = 53210 (not normal)

 

Optional parameters:

/backlog=#     Report on Backlog > #

                 If omitted this report is not generated.

                 Warning: This is very time consuming.

/db=path\file  Specify the path and filename of the MDB file to use.

                 If omitted, db1.mdb is assumed to be in the current folder

 

Output configuration

/o=path\file   Specify the path and filename to save the report to.

                 If omitted the report will be stored in the current directory.

                 If the filename is omitted DFSRCheck.yyyy-mm-dd_hh_mm_ss.ext

                   is used.  A Path must end with '\'

/f=csv,tsv,html  Specify the report file type to create.

                   If omitted HTML is assumed.

Examples:

  DFSRCheck /s=server1

  DFSRCheck /s=server1 /o=c:\inetpub\wwwroot\ /db=c:\db\mydb.mdb

  DFSRCheck /i=servers.txt /backlog=1000

  DFSRCheck /i=servers.txt /backlog=1000 /o=C:\myreports\ /f=csv

  DFSRCheck /r /service=1 /sync=432 /conn=1 /member=0 /folder=4

 

 

Example Output of DFSRCheck

C:\> dfsrcheck /i=servers.txt /backlog=500 /o="C:\Inetpub\wwwroot\DFSRCheck\"

Author: NetworkAdminKB.com

Version: 1.4.8

Copyright (c) 2008-2011 NetworkAdminKB.com, All rights reserved.

Bug Report: bugs@networkadminkb.com

Purpose: Perform health checks of DFS-R on one or more servers

           and their partners.

 

Processing Server: DFS-MAIN01

Processing Server: DFS-MAIN02

Processing Server: DFS-MAIN03

Processing Server: DFS-MAIN04

Processing Server: DFS-MAIN05

Processing Server: DFS-MAIN06

Processing Partner Server: DFS-Site01

Processing Partner Server: DFS-Site02

Processing Partner Server: DFS-Site03

Processing Partner Server: DFS-Site04

Processing Partner Server: DFS-Site05

Processing Partner Server: DFS-Site06

Processing Partner Server: DFS-Site07

Processing Partner Server: DFS-Site08

Processing Partner Server: DFS-Site09

Processing Partner Server: DFS-Site10

Processing Partner Server: DFS-Site11

Processing Partner Server: DFS-Site12

Processing Partner Server: DFS-Site13

Processing Partner Server: DFS-Site14

Processing Partner Server: DFS-Site15

Processing Partner Server: DFS-Site16

Processing Partner Server: DFS-Site17

Processing Partner Server: DFS-Site18

Processing Partner Server: DFS-Site19

Processing Partner Server: DFS-Site20

Gathering Backlog information, this may take a while.

Writing report to file C:\Inetpub\wwwroot\DFSRCheck\DFSRCheck.2011-08-09_07_00_00.html

DFS-R Health Check
Date Collected: 2011-08-09 07:00:00

DFS-R Service Status Report
Service Status = Service Shutting Down OR Service Degraded OR Service Starting

MemberName

State

LastErrorCode

LastErrorMessage

No records found

 

 

 

 

DFS-R Member Status Report
Member Status = In Error OR Shutting Down

MemberName

ReplicationGroupName

State

LastErrorCode

LastErrorMessageId

No records found

 

 

 

 

 

DFS-R Connection Status Report
Connection Status = In Error OR Offline OR Connecting

MemberName

PartnerName

ReplicationGroupName

State

LastErrorCode

LastErrorMessage

No records found

 

 

 

 

 

 

DFS-R Folder Status Report
Folder Status = In Error OR Auto Recovery OR Initial Sync OR Initialized OR Uninitialized

MemberName

ReplicatedFolderName

ReplicationGroupName

State

DFS-MAIN03

SITE20

domain.local\apps\site20

Initial Sync

DFS-MAIN04

SITE03

domain.local\home\site03

Initial Sync

DFS-Site20

SITE20

domain.local\apps\site20

Initial Sync

 

DFS-R Sync Status Report
Folder Status = In Error OR Interrupted OR Connecting OR Initialized

MemberName

PartnerName

ReplicationGroupName

State

LastErrorCode

LastErrorMessageId

DFS-MAIN06

DFS-Site19

domain.local\apps\site19

In Error

8

0

 

DFS-R Backlog Status Report
Backlog File Count > 500

MemberName

ReplicatedFolderName

ReplicationGroupName

BacklogFileCount

DFS-SITE03

SITE03

domain.local\home\site03

11389

DFS-SITE07

SITE07

domain.local\home\site07

5621

 

 

 

Using the report only (/r) option

The ability to create and use a database file to store information about the last DFS-R Health Check that has taken place can be beneficial to run multiple reports in very little time.

 

Consider the following scenario.  Company XYZ has one main site that all other sites replicated their data to for backup.  The company has over 100 of these sites.  The IT manager places high importance on the nightly backups, so the DFS replication must be successful on a regular basis.  Because of this the IT Manager insists that the IT Staff run reports showing both the normal activity and any problem activity of all DFS connections.  Running a single report against this many sites and this many connections will take a long time (10-30 minutes or longer).

 

To solve this problem the database and the report only option were implemented into DFSRCheck.  Simply run DFSRCheck the first time without the /r option, then do any follow up reporting by running the DFSRCheck again with the /r option.  The key thing to remember is that the Backlog information is optional.  So the Backlog information must be gathered in the first run of DFSRCheck to be available in the follow up report only runs.

 

In this example the IT Staff decided to initially accept the default problem reports created by DFSRCheck and specify an input file of servers to process (/i=servers.txt), along with a desired minimum backlog count of 1000.  The follow up report would report on the normal states for all report types and show all backlog counts (/backlog=0).

Dfscheck /i=servers.txt /backlog=1000

Dfscheck /r /service=3210 /sync=6543210 /conn=3210 /member=210 /folder=543210 /backlog=0

 

 

Using the DFSRCheck Utility for HTML Reporting

Because the DFSRCheck utility can output HTML report files, you can configure the utility to run nightly on any Web Server and place its HTML reports in a folder used by a web site on the server.  For example:

 

dfsrcheck /i=servers.txt /backlog=500 /o=c:\inetpub\wwwroot\DFSRreports\

 

By not specifying a file name in the output path (/o switch) an HTML file similar to the following will be created:  DFSRCheck.yyyy-mm-dd_hh_mm_ss.html

 

Configure the associated web site for directory browsing and you have a daily history of you DFS-R status reports at your finger tips.

 

Using the DFSRCheck Utility for CSV or TSV Reporting

You can use the format (/f switch) to specify the output file type to create.  By specifying /f=csv or /f=tsv you can create either CSV or TSV formatted reports and quickly import them into any spreadsheet or view them in a text editor, or send the via email easily.

 

 

Download DFSRCheck today!!! 

Article ID: 279, Created On: 9/18/2011, Modified: 9/18/2011

Comments (4)

Greg Youngers

Any chance you could change the source code to allow more than 50 characters (TEXT) for Replication Group names, etc.? Errors and data being missed as a result of the db fields being too small.

10/9/2013 at 3:24 PM
KBAdmin

I have no immediate plans to update the product. Thanks for lettings others know about this limitation. Workaround, reduce the length of the path you replicate.

11/16/2013 at 8:43 PM
Alex

This tools seems to be everything I need, only I can't get it working.
I tried running it on my Win7 pro workstation (with DFS admin server tools installed) and on our central fileserver, but always get the same result.
When I run 'dfsrcheck.exe /s=<servername>' it returns:
0x1B6 - Object doesn't support this property or method

i ran this command with the domain administrator account so rights should be no issue.
Also the 'DFSRMon' tool (found here:http://blogs.technet.com/b/suporte/archive/2010/09/17/dfsrmon-v1-1-0.aspx) works perfectly.

10/9/2013 at 8:18 AM
KBAdmin

This is usually caused because of simple issues like UAC enabled. After that Objects failing to be created are directly related to issues on the server with ADO DB objects, WMI, etc. I know this utility works 100% of the time on out of the box Windows 2008 R2 with UAC disabled with no group policies applied, etc. Beyond that I can't help.

I would start testing that configuration verify it works, and then add in all your standard server configuration to find what breaks it.

Finally someone from Microsoft came out with something better than their built in utilities.

11/16/2013 at 8:45 PM
Kapil

Hi there,

Your script is fabulous. Can you modify a little bit to get the filename of the backlog files on your report? Likewise this command dfsrdiag backlog /sendingmember:sending_server_name /receivingmember:receiving_server_name /rgname:replication_group /rfname:replication_folder ?

Thanks.

4/25/2013 at 10:30 AM
Joshua M. Andrews

Great utility! I've been using it for about 5 months now and it works great! However, I'd like to request a little more description of the different states/errors that are reported.

For example, today the script tells me the following under the DFS-R Folder Status Report:

DFS1 Advertising mydomain.local\storage\advertising Uninitialized

And under the DFS-R Member Status Report section it says:

DFS1 mydomain.local\storage\advertising Shutting Down 0 0

What do these mean and how can I resolve them? I know I can google the stuff but perhaps when a particular error shows up you can link to your website with more details about potential resolution ideas or even include a brief section at the bottom of the email to help speed up the resolution process?

Keep up the great work!

5/24/2012 at 2:44 PM
KBAdmin

For each error you discover you should run the Microsoft DFS Health Report for more information and ways to fix the issue. http://technet.microsoft.com/en-us/library/cc778105(v=ws.10).aspx

The information returned by DFSRCheck is standard WMI DFSR terminology. Review the WMI DFSR Classes here for more information. http://msdn.microsoft.com/en-us/library/windows/desktop/bb540028(v=vs.85).aspx

In general each section of the report has easily idenified WMI Classes that it uses. Folder Secion -> DFSRReplicatedFolder*, etc.

In gerenal the report is ordered by the building blocks of DFSR (Service -> Members -> Connections -> Folders -> Sync Session). An error in earlier sections will produce errors in later sections. Troubleshoot the earlier errors in the report, not the later.

For general knowledge review and understand the DFSR Sync Diagram here http://msdn.microsoft.com/en-us/library/windows/desktop/bb540021(v=vs.85).aspx.

8/18/2012 at 2:44 PM