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