Cleaning up the DFS errors

Some DFS-related errors, such as “Cannot enumerate namespace“, “Element not found” or “RPC server is not available” are related to the configuration issues in namespace. All  DFS components in registry, Active Directory and file system should be in sync. If they are not, the mentioned above errors happen. Pretty often it is easier and faster to remove DFS namespace completely and recreate it rather than to fix it. This article is about removing a DFS namespace and cleaning up all its components.

Let’s assume we have a DFS namespace called “DFS_A” in the “” domain, that experiences some troubles and we need to remove it completely. You’d better to run the following commands on all your DFS servers and domain controllers. Here’s the steps:

  • All DFS servers:

$LocalComputer= (HostName)
Get-DfsnRoot -ComputerName $LocalComputer |Where type -NotMatch “Standalone”

This will give you list of all DFS namespaces. It usually errors out on the bad namespace.

  • All DFS servers:

Run Get-DfsnRootTarget –Path \\\DFS_A

This command will give you the list of all the servers, the DFS_A namespace is located on to be sure that you do not miss any of them

  • All domain controllers:

Run ADSIEDIT. Go to\System\Dfs-Configuration\dfs and delete the DFS_A namespace

  • All DFS servers and domain controllers:

Run REGEDIT. Go to HKLM\Software\Microsoft\Dfs\Roots\Domain and delete the DFS_A namespace

  • All DFS servers:



If you see the “The share must be removed from the Distributed File System before it can be deleted.” error, restart DFS server and try to delete shared folder after restart.


to confirm that you do not have the DFS_A shared folder anymore

  • All DFS servers:

Start up the Windows Explorer and delete DFSRoots\DFS_A folders. Then restart the DFS Namespace service.

  • Wait for 30 minutes for replication and you should be able to recreate the namespace without any problems

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: