Often stuck with an orphaned shared folder?
I did, many times. Moreover when I go ahead and try to delete it, I am hit with an error message saying “The share must be removed from the distributed file system before it can be deleted”
There is an easy way out:
Either find the registry entry for that DFS under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DFS\Roots\Domain and delete the key named with the DFS name.
If you in love with command-line like me, run the command
dfsutil /clean /server:<server-name> /share:<dfs-root-name>
The next step is to go to services and restart the service called “Server”. “DFS Namespaces” service is dependent on it, so go ahead and accept the prompt that says this will restart DFS Namespaces.
Now go back to the share and remove it without any problems.