Microsoft has several command-line tools for scripting, creating, modifying, or just viewing the Distributed File System (DFS) structure. Because the Dfsutil.exe and Dfscmd.exe tools can modify and delete DFS settings, use these tools carefully to avoid causing permanent damage to your production environment.
Microsoft first provided Dfsutil.exe with the Windows 2000 Support Tools, and the utility is also available in the Windows Server 2003 Support Tools. In the DFSReportBuilder.bat script (which you can download at InstantDoc ID 92798), we use the Dfsutil.exe tool in a /Viewmode, but the tool has more than 30 other commandline switch options. To see these options, type Dfsutil /?at a command prompt.
Note that early versions of Dfsutil.exe had some problems that could damage DFS metadata. To be sure you have the correct version, check the Microsoft article "Updates to Dfsutil.exe" at http://support.microsoft.com/?kbid=293114.
Dfscmd.exe was first available as a built-in tool in Windows 2000 and is included in Windows Server 2003. Probably one of the most useful features of this tool is the /batch mode, in which the tool can help you create a batch file that you can use to recreate your DFS environment. To see the switch options, type dfscmd /?at a command prompt.
also has some known problems. When you use the tool in /batch mode, it might not properly restore shares that contain spaces. The problem is described in the Microsoft article "'DFSCMD /BATCH' Command Cannot Handle Spaces in Share Names" at http://support.microsoft.com/Default.aspx?kbid=278884.
The Dfsradmin.exe tool is a Windows Server 2003 Release 2 (R2) command-line tool that you use to administer DFS replication, including creating replication groups and replicated folders, adding members to replication groups, and managing the location of staging folders. For more details about using Dfsradmin.exe, see the Microsoft Help document "DFS Operations Guide: Using the DFSRAdmin Command-line Tool" at http://www.microsoft.com/downloads/details.aspx?familyid=49caf978-49e9-4eb6-9cc9-72b5dd160505&displaylang=en.
Finally, a useful non–command-line tool is FranzO Software's Explore Behind DFS, which you can download free at http://www.franzo.co.nz/ExploreBehindDFS. This tool can be helpful if you deal with lots of DFS problems because it lets you right-click a folder that's accessed through DFS and see its location path.