Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Right now each employee has their own share on the file server that uses their first initial of their first name and their last name (ex. jsmith). Of course John Simth has to be logged on to access the share jsmith.

The Issue: Right now I have two options to establish the jsmith share everytime a employee logins into the domain creating a domain profile for the 1st time. I ether 1.) manually map the drive to the share. Or 2.) use the VBScript below and manually open it or manually put it in the startup folder.

The Goal: I woud like to use a GPO login script or the GPO map drive function to make sure the employee has their personal share (mapped to W:). Right now the only solution I can figure out is to add the VBScript below as a Login script(using GPO), BUT it will not run like it should. There is NOTHING wrong with the script if I manually put it on the users computer and click it. But how would I make sure the users personal share is being mapped everytime the login to the domain on ANY computer? NOTE: I do not need to use the login script below, but its the only option I currently know of.


    ' Section removes W drive if exists
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objNetwork = CreateObject("Wscript.Network")

If (objFSO.DriveExists("W:") = True) Then
    objNetwork.RemoveNetworkDrive "W:", True, True
End If

' Section Remaps W drive based on User Name, the OU is also stored but not used.

Set objSysInfo = CreateObject("ADSystemInfo")

strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

strUserName = objUser.samAccountName

strOUPath = objUser.Parent
arrContainers = Split(strOUPath, ",")
arrOU = Split(arrContainers(0), "=")
strOU = arrOU(1)

strDrive = "\\SERVER001\" & strUserName

strFirstInt= Left(strUserName,1)

strLastName= Split(strUserName, " ")(1)

strDrive = "\\\" & strFirstInt & strLastName
'WScript.Echo (strDrive)

Set objNetwork = CreateObject("Wscript.Network")
objNetwork.MapNetworkDrive "W:", strDrive
share|improve this question
whats wrong with using the home folder option in ADUC? – Keltari Aug 22 '13 at 14:17
I dont know. I've never used it. Like I said, I know only one way, which is using a script. – Benjamin Jones Aug 22 '13 at 14:17
I will look this up. – Benjamin Jones Aug 22 '13 at 14:18

Open Active Directory Users and Computers, find a user, right-click and select Properties. Select the Profile tab. Under Home Folder select a driver letter and UNC path. enter image description here

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .