Configuring or monitoring DFS in Windows 2008 environments is a task that normally gets invoked from the Server Manager console and aided by a corresponding wizard as you can see in this post. However, you can use the DFSUtil command to manage DFS from a command prompt or script. In addition, to troubleshoot DFS from the command line, you can use the DFSDiag command. Make sure that the DFS role is installed from Server Manager before trying out these examples that belong to our test domain environment called env1.testlab:
To display all domain-based namespaces in a domain, type:
Dfsutil domain <domain_name> ex: dfsutil domain env1.testlab
To display the roots on a specific server called Win2k8FileShare, type:
Dfsutil server <server_name> ex: dfsutil server Win2k8FileShare
To display the domain cache, type:
Dfsutil cache domain ex: dfsutil cache domain
Or to flush the domain cache, type:
Dfsutil cache domain flush ex: dfsutil cache domain flush
To check the DFS domain controller configuration, type:
Dfsdiag /testdcs
To check the configuration of a DFS namespace called Test1Namespace, type:
Dfsdiag /testdfsconfig /dfsroot:\\env1.testlab\test1namespace
In this configuration check, the command verifies that the DFS namespace service is running and that its Startup type is set to Automatic. Also, it checks that the DFS registry configuration is consistent among namespace servers and validates the dependencies on clustered namespace servers.