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

Map user to home folder in AD

Status
Not open for further replies.

c7oi

Technical User
Jul 13, 2005
4
0
0
US
I am new in scripting, don't know much command lines. I would like to write a script that map users to they home folder that is assign in their Active Directory Users and Computers property. How would I do that?
 
In your login script, you can add something like this:

Code:
Set WshNetwork = CreateObject ("Wscript.Network")
UserName = wshNetwork.Username
WshNetwork.MapNetworkDrive "y:", "\\SERVER01" & UserName

Or, if you have multiple sites and want to check based on the login server, check out faq329-5798 and faq329-4871. (You can also do a lot of other things in your login script as shown in the FAQs)
 
If you want to use exactly what is assigned in their AD profile you'll need this too:

Set objUser = GetObject ("LDAP://cn=somebody,ou=somewhere,dc=domain,dc=com")

HDir = objUser.HomeDirectory
HDrive = objUser.HomeDrive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top