Question Locked

dsmod update to users home directory

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,
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

3 replies

by lowlands

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")
objOU.filter=array("user")
For Each ObjUser In ObjOU

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

ObjUser.SetInfo
Next
Set objOU = Nothing

by sstetson

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.

This discussion is closed to new replies.