At least once a month a customer asks for a command-line method to enable and disable referrals for a folder target (aka link target). Neither dfscmd.exe nor dfsutil.exe provides a way to do this. In response to the many requests we get for this functionality, we’ve posted some sample code that can be compiled into an executable tool for enabling and disabling referrals. Many thanks to Dan Lovinger, one of our DFS developers, for providing this!

Here are the parameters for using the tool:

modlink <DfsEntryPath> <ServerName> <SharePathName> [<on|off>]

 And here’s an example of disabling a referral:

modlink \\contoso.com\dfsroot\dir\sharename  server1.contoso.com sharename off

 The above command disables the folder target (aka link target) \\server1.contoso.com\sharename of the namespace folder \\contoso.com\dfsroot\dir\sharename.

--Jill