4
Reply

Problem automatically mapping homedrive

baars

baars

May 13 2005 4:57 AM
3.3k
Hi all, I created a piece of code to create users in our active directory (2003) Everything is working OK and all attributes are set correctly. Only if i logon with a created user i do not get the mapping H: to the homedrive. When looking in AD users & computers the path to the homedir is correct. Also permissions on the homedir are correct and the user is owner of the dir. If i correct the path in AD users & computers to another path and change it back again to point to the homedir the drive mapping is made correctly, so it look's like some kind of attribute is not set correctly. I used ldp.exe to view the created user's attributes before and after modifying the path but don't see any difference. Tried to create the dir before and after user creation but that's not making any difference. I hope someone can give a helping hand. [code] NewUser.Properties("sAMAccountName").Value = userid NewUser.Properties("description").Add(func) NewUser.Properties("mail").Add(email) NewUser.Properties("displayName").Add(firstn & " " & lastn) NewUser.Properties("userPrincipalName").Add(userid & "@myorg.corp.local") NewUser.Properties("homeDirectory").Add("\\fileserver\users$\" & userid) NewUser.Properties("homeDrive").Add("H") NewUser.Properties("profilePath").Add("\\cyg7006\profiles$\" & userid) NewUser.Properties("telephoneNumber").Add(telephone) NewUser.Properties("physicalDeliveryOfficeName").Add(locat) NewUser.Properties("wWWHomePage").Add("http://www.google.com") NewUser.Properties("sn").Add(lastn) NewUser.Properties("givenName").Add(lastn) NewUser.Properties("scriptPath").Add(script) NewUser.Properties("streetAddress").Add("blastreet 29") NewUser.Properties("l").Add("Amsterdam") NewUser.Properties("st").Add("NH") NewUser.Properties("postalCode").Add("1061 GJ") NewUser.Properties("c").Add("NL") NewUser.Properties("postOfficeBox").Add("19359 1060 CK Amsterdam") NewUser.CommitChanges() NewUser.Invoke("SetPassword", New Object() {passwrd}) NewUser.CommitChanges() NewUser.Properties("userAccountControl").Value = 512 NewUser.CommitChanges() [/code]

Answers (4)