Use dfscmd.exe for scripted DFS mappings
When using DFS, you might want to consider adding DFS links for user home and profile directories to a DFS root. If you want to integrate this into a script, try the following command-line:
“%SystemRoot%dfscmd.exe” /map “%DFSHomeRoot%%AD_username%” “\%HomeServer%%HomeShare%%AD_username%”
Variable explanation:
%SystemRoot% = C:WINDOWSSystem32
- %DFSHomeRoot% = the DFS root you want the folder linked to
- %AD_username% = the sAMAccountName attribute for the user, in this case the name of the folder
- \%HomeServer%%HomeShare%%AD_username% = UNC path to the folder which needs the link