Set home directories even if it's a hidden share

06 Jul 2011

There exists an issue with DSMOD that prevents you from modifying the -hmdir with a share that has a dollar sign in it. According to the dsmod.exe example:

The special token $username$ (case insensitive) may be used to place the
SAM account name in the value of -webpg, -profile, -hmdir, and
-email parameter.
For example, if the target user DN is
CN=Jane Doe,CN=users,CN=microsoft,CN=com and the SAM account name
attribute is “janed,” the -hmdir parameter can have the following
substitution:

-hmdir users$username$home

The value of the -hmdir parameter is modified to the following value:

  • hmdir usersjanedhome

This does not work if your home directory is structured like so:

-hmdir users$$username$home

The value returned by DSMOD is actually:

To fix this you can use the awesome ADFIND and ADMOD from Joeware.

The command to fix set it correctly would be:

adfind -b "OU=TEST - Trentent,DC=lab,DC=com" -adcsv -f "(&objectClass=user)" samAccountName | admod homeDirectory::\\test\test$\ homeDrive::Z:

Go Joe!