Scenario
You want to create, modify or Migrate to a nice new DFS Architecture and/or migrate data to new file servers/targets, and want to populate all your nice new links with new folder targets, yet ensuring users do not access them while you do this. So we create the targets via the GUI and set to Disable. Done. ! However the problem is you have hundreds of Links and Targets. So here comes a severe case tendentious, or we sort to engage Mr Script.
Solution
My Idea of tendentious and GUI screen burn does not bode to well for me as a concept, so utilizing the much more feature rich DFS comdlet of DFSUTIL.EXE is a far better and quicker option. So presuming you have completed your required planning on what, where and how the DFS and Shares are going to look, we put DFSUTIL.EXE into action. (Remember Excel and Notepad are your friend)
Adding a Folder Target to en existing DFS Link
dfsutil target add "\\contoso.local\dfsshare\Shared Files\HR" "\\Filserver1\Share\HR"
Making the Folder target Offline (Disabled)
dfsutil property state offline "\\contoso.local\dfsshare\Shared Files\HR" "\\Filserver1\Share\HR"
Making the Folder target Online (Enabled)
dfsutil property state Online "\\contoso.local\dfsshare\Shared Files\HR" "\\Filserver1\Share\HR"
Happy Migrating !