Question

Locked

dsmod update to users home directory

By mercury11703 ·
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

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

bug

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:

<b>
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
</b>

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.

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums