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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Home drive/folder letter using ADSI?

Status
Not open for further replies.

sunil5

IS-IT--Management
Dec 17, 2003
100
GB
Hi all,

I asked a similar question earlier regarding this but was only given solutions to map 'standard' drives.

What I want is to actually change the Drive letter assignment (in AD) for all domain user accounts via some sort of script using ADSI- where the existing value 'H:' is changed to something else.

Thanks in advanced.

Sunil
 
I've managed to get the following code to change drive letter a for single user. Any coding experts able to change it to work for all users at once?

Dim User
Dim UserName
Dim UserDomain
Dim NewValue
UserDomain = "user_domain"
UserName = "username"
NewValue = "new_value:"
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
User.Put("HomeDirDrive"), NewValue
User.SetInfo

Any help would be much appreciated.

Sunil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top