Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem updating home directory attributes in AD

Status
Not open for further replies.

IainT

MIS
Nov 21, 2003
15
GB
Hi folks. I'm using the following script to change the home directory attributes for all the users in a given Active Directory OU:


Set OU = GetObject("LDAP://OU=users,OU=schoolname,OU=schools,DC=test,DC=elc")

For Each objUser In OU
If objUser.Class = "user" Then
objUser.Put "homeDirectory", "\\dc\" + objUser.SAMAccountName
objUser.Put "homeDrive", "Z"
objUser.SetInfo
End If
Next
WScript.echo "OU has been updated!"
WScript.quit


The script changes the attributes as expected. However, after the script has been run, the home dir is not mapped at logon. The only way to make it start working is to open the user in AD, edit the home directory in any way (i.e. add a space to the end and then delete it again), and apply the "changes" - after this, the home dir is mapped at logon correctly. Any ideas?
 
Never mind, problem solved - homeDrive attribute requires a colon as well as a letter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top