I had the need to combine multiple Windows shares into one DFS Folder / Location. Anyone that uses DFS knows that you can either create links to the top level share or its sub folder and that there is no way to automatically combines all the folders together

Creating links to all the sub folders is fine if you have 10 or 20, but what if you have 350 links to create. Such as in my case, I had the need to create links to all the “Users” folders for every one of my departments.

Doing this would allow me to point all my scripts / group policies to one single location, without putting all the user folders on one server.

Here is the script

That’s it. This script will scan the shares, take every sub folder and add a link to the sub folder under the DFS folder I designated. For my purpose, I used it to combine user folders, and its been working great in production for months now.

You can use this script to combine any folder, except for 1 catch. Last I checked, DFS has a limit of 5000 links per “name space”, so if  you are worried about approaching that limitation, you can always create a separate namespace specifically for the user folders or whatever other folders you are planning to combine.

Facebook Twitter Email Linkedin Digg Delicious