dsmod update to users home directory

By mercury11703 ·
I'm using the following script to update the path of users home directory in Windows 2000 domain.
dsquery user "OU=Users,OU=TS Test,DC=Test,DC=com" -limit 0|dsmod user -hmdrv F -hmdir \\server\users$\$username$

The user share is hidden that, but with the $ in the path the update does not work. If I remove the $ it works fine.

Please helo

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -


by lowlands In reply to dsmod update to users hom ...

This appears to be a bug in the use of dsmod. It will not replace the $username$ variable with the real username if another $ is present in the command/path.

try a vbscript instead, something like the script below should work:

Set ObjOU=GetObject ("LDAP://OU=Users,OU=TS Test,DC=Test,DC=com")
For Each ObjUser In ObjOU

ObjUser.Put "homeDirectory" , "\\server\users$\" & ObjUser.sAMAccountName
ObjUser.Put "homeDrive" , "F:"

Set objOU = Nothing

Collapse -

day late, dollar short

by sstetson In reply to dsmod update to users hom ...

well, to not answer your question. you are right, dsmod does not handle hidden shares and the $username$ variable correctly. or at least my quick attempts at finding an escape sequence did not produce results.

Related Discussions

Related Forums