Automatically Map Home Drive


How can I Automatically map the users home drives?

Server 2008 r2 domain, windows xp and win 7 computers.

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

MightySWConnect With a Mentor Commented:
Hi, From Microsoft.

Assign a home folder to a domain user
Note: To specify a network path for the home folder, you must first create the network share and set permissions that permit the user access. You can do this with Shared Folders in Computer Management on the server computer.

To assign a home folder to a domain user:
Click Start, point to Programs, go to Active Directory Users and Computers.
In the console tree, click Users.
In the Details pane, right-click the user account, and then click Properties.
In the Properties dialog box, click Profile.
Under the Home folder, type the folder information. To do this, follow these steps:
To assign a home folder on a network server, click Connect, and then specify a drive letter.
In the To box, type a path. This path can be any one of the following types:
Network path, for example:
You can substitute username for the last subfolder in the path, for example:
\\server\users\username  (You should use %username%)
Note In these examples, server is the name of the file server housing the home folders, and users is the shared folder.
Click OK.
DAgentAuthor Commented:
Can this set to be done when ever a new user is created?
SCCMCanuckNetwork AnalystCommented:
Yes, as MightySW has stated above the section repeated below deals with this:

You can substitute username for the last subfolder in the path, for example:


%username% will essentially tell AD to create a homefolder as the specified user account name. The typical thing to do would be to create a template account that is disabled with the %username% variable method above. Anytime you wish to create a new user simply copy the template account, enter the user specific information and enable the copied account.

Anytime you carry out this process a user should be created witha mapped drive of their account name and the drive should map automatically.
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

DAgentAuthor Commented:
Sorry I should have been more clear.

Can you set the create new user tab to alwasy have H:\\server\users\%username%

So when you make a new user it has the H:\\server\users\%username% filled in?
No, you should just think about using a GPO login script then.  

This will allow you to map to home drives without annoying dos login scripts.
You can setup a template user then right click copy and it will retain the mapping to the home directory you specified on the template but with the updated username

this script vbs allow you to map users home drives

' MNDUserName.vbs
' VBScript to map a network drive to the UserName.
' Author Guy Thomas
' Version 1.3 - April 24th 2005
' -----------------------------------------------------------------'
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUserName
strDriveLetter = "J:"
strRemotePath = "\\joe\home"

' Purpose of script to create a network object. (objNetwork)
' Then to apply the MapNetworkDrive method. Result J: drive
Set objNetwork = WScript.CreateObject("WScript.Network")
' Here is where we extract the UserName
strUserName = objNetwork.UserName
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath _
& "\" & strUserName

' Extra code just to add a message box
WScript.Echo " Launch Explorer, check: "& strDriveLetter

' End of MapNetworkDrive Example logon script.
Can you set the create new user tab to alwasy have H:\\server\users\%username%

you can right click on an existing user and click copy.  That will retain the users home directory settings in the profile tab and automatically create the home directory folder with all the rights.

You won't need to include that mapping in the logon script because AD will do it for you automatically.
Were you able to get it working????
DAgentAuthor Commented:
Thank you all!
All Courses

From novice to tech pro — start learning today.