When you come across orphaned DFS Namespaces in your domain environment and want to remove those either to clean up or to reuse. You will need to do it from ADSI Edit.
- Connect to Default naming context
- Navigate to CN=Dfs-Configuration,CN=System, DC=mydomain, DC=local
- Right click on the orphaned namespace and delete it
This post is about doing just that via the PowerShell Script instead of using ADSI Edit. There is an enormous risk associated with using ADSI Edit if you misclick and delete something else by mistake.