Disabling and enabling DFS namespace referrals from the command-line

Published 04-10-2019 01:13 AM 241 Views
Not applicable
First published on TECHNET on Jul 25, 2006
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.comdfsrootdirsharename server1.contoso.com sharename off

The above command disables the folder target (aka link target) \server1.contoso.comsharename of the namespace folder \contoso.comdfsrootdirsharename .

--Jill

%3CLINGO-SUB%20id%3D%22lingo-sub-423251%22%20slang%3D%22en-US%22%3EDisabling%20and%20enabling%20DFS%20namespace%20referrals%20from%20the%20command-line%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-423251%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20TECHNET%20on%20Jul%2025%2C%202006%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%20At%20least%20once%20a%20month%20a%20customer%20asks%20for%20a%20command-line%20method%20to%20enable%20and%20disable%20referrals%20for%20a%20folder%20target%20(aka%20link%20target).%20Neither%20dfscmd.exe%20nor%20dfsutil.exe%20provides%20a%20way%20to%20do%20this.%20In%20response%20to%20the%20many%20requests%20we%20get%20for%20this%20functionality%2C%20we%E2%80%99ve%20posted%20some%20%3CA%20href%3D%22http%3A%2F%2Fblogs.technet.com%2Ffilecab%2Farticles%2F443319.aspx%22%20mce_href%3D%22http%3A%2F%2Fblogs.technet.com%2Ffilecab%2Farticles%2F443319.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20sample%20code%20%3C%2FA%3E%20that%20can%20be%20compiled%20into%20an%20executable%20tool%20for%20enabling%20and%20disabling%20referrals.%20Many%20thanks%20to%20Dan%20Lovinger%2C%20one%20of%20our%20DFS%20developers%2C%20for%20providing%20this!%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20Here%20are%20the%20parameters%20for%20using%20the%20tool%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20modlink%20%3CDFSENTRYPATH%3E%20%3CSERVERNAME%3E%20%3CSHAREPATHNAME%3E%20%5B%3CON%3E%5D%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20And%20here%E2%80%99s%20an%20example%20of%20disabling%20a%20referral%3A%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20modlink%20%3CA%20mce_href%3D%22file%3A%2F%2F%5Ccontoso.comdfsrootdirsharename%22%20target%3D%22_blank%22%3E%20%5Ccontoso.comdfsrootdirsharename%20%3C%2FA%3E%20server1.contoso.com%20sharename%20off%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%20The%20above%20command%20disables%20the%20folder%20target%20(aka%20link%20target)%20%3CA%20mce_href%3D%22file%3A%2F%2F%5Cserver1.contoso.comsharename%22%20target%3D%22_blank%22%3E%20%5Cserver1.contoso.comsharename%20%3C%2FA%3E%20of%20the%20namespace%20folder%20%3CA%20mce_href%3D%22file%3A%2F%2F%5Ccontoso.comdfsrootdirsharename%22%20target%3D%22_blank%22%3E%20%5Ccontoso.comdfsrootdirsharename%20%3C%2FA%3E%20.%20%3CBR%20%2F%3E%20%3CBR%20%2F%3E%3CP%3E--Jill%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%20%3CP%3E%3C%2FP%3E%0A%20%0A%3C%2FON%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-423251%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20TECHNET%20on%20Jul%2025%2C%202006%20At%20least%20once%20a%20month%20a%20customer%20asks%20for%20a%20command-line%20method%20to%20enable%20and%20disable%20referrals%20for%20a%20folder%20target%20(aka%20link%20target).%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-423251%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Edfs%20namespaces%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3C%2FSHAREPATHNAME%3E%3C%2FSERVERNAME%3E%3C%2FDFSENTRYPATH%3E%3C%2FLINGO-BODY%3E
Version history
Last update:
‎Apr 10 2019 01:14 AM
Updated by: