Mapping a users home directory

kingsleytim

Limp Gawd
Joined
Jan 19, 2005
Messages
364
Can anyone give me some help with mapping a users home directory through the domain on server 2003? I want to rty and do this through a script instead of using the home path in each individual users profile. Any help would be appreciated as to how i can map the home directory to a shared folder on my file server.
 
This is a Very basic script that will map drives:

Dim wshNetwork
Set wshNetwork = CreateObject("Wscript.Network")
wshNetwork.MapNetworkDrive "x:", "\\snow2\downloads"
WSCript.Quit

Copy and paste into notepad. Replace "x" with the drive letter, and "\\snow2\downloads" with the server name and name of directory. Save as anyname you want, with .vbs extension. Copy file to Netlogon shared folder (usually SystemRoot\SYSVOL\Sysvol\DomainName\Scripts where DomainName is the domain's fully qualified domain name). Then add the name to the user account under scripts. When the user logs in again there will be a network drive added.
 
Thanks but i need a script that will map all home drives so i wont have to make a script per user for logon. Im sorry if i wasnt clear on that in my first post. I need a script to remap all users home drives.
 
Try adding something like...
Code:
dim UserShareName
UserShareName="\\server\" & wshNetwork.UserName & "$"
to the above script. Assuming of course your home drives are hidden shares named after the username. If your naming convention is different you may be able to do something similar.

EDIT : Just curious, but why don't you want to use the home directory function?
 
RaisedBlock said:
EDIT : Just curious, but why don't you want to use the home directory function?

Was just going to ask that..
anyways, if you want something that is easy to use and can do your entire domain with a couple of clicks, try Desktop Authority I have used this program with several clients whose IT staff don't have the full experience in managing a domain. This program will map printers, does just about all of the things that you would want to do, under one GUI
 
RaisedBlock said:
Try adding something like...
Code:
dim UserShareName
UserShareName="\\server\" & wshNetwork.UserName & "$"
to the above script. Assuming of course your home drives are hidden shares named after the username. If your naming convention is different you may be able to do something similar.

EDIT : Just curious, but why don't you want to use the home directory function?


Because we are migrating over to windows server 2003 and have many users. It would be more efficient and take a lot less time to use a script then to manually set each profile. I think i found a way around the issue, thanks for the suggestions.
 
Try this:

Code:
net use h: /home

That is what I have in all my login scripts, and it automatically maps the drives. If I ever move the home drives I just use the following lines in the login scripts:

Code:
net use h: /delete /y
net use h: /home

First line deletes the old mapping, the second remaps it to the new drive. This does mean you have to have the home directory set in the User account.
 
ianshot said:
Try this:

Code:
net use h: /home

That is what I have in all my login scripts, and it automatically maps the drives. If I ever move the home drives I just use the following lines in the login scripts:

Code:
net use h: /delete /y
net use h: /home

First line deletes the old mapping, the second remaps it to the new drive. This does mean you have to have the home directory set in the User account.

It should update if the home directory in the user account is modified (on next login).

I suggest looking a vbscript - you can interface with the AD & change the values programaticaly. It's not too difficult.

http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_overview.mspx?mfr=true

You could enumerate all users within a specific OU, loop through and modify their home directories. As long as it's a regular naming scheme (\\server\username or something) you should be able to script through it easily.

http://www.microsoft.com/technet/scriptcenter/scripts/ad/users/modify/usmdvb31.mspx
 
Why not use the home directory in the profiles area of the user account?????

You want to map per user.
You want it to be mapped on startup.

That is what that area is for!

\\server\share\%username% is what you put there

If you have 1,000 users already in the system, and that is why you didn't want to do that because you would have to go back to every account, JUST HIGHLITE THEM ALL, RIGHT CLICK, PROPERTIES. CHECK THE BOX NEXT TO HOME DIRECTORIES, AND TYPE THE ABOVE.

Most people hate using the built-in features, but that is what they are there for....

Cheers,

Liquid
 
hahaha nice liquid - i've never done multiselects in aduc and i've been using it since beta 2 of w2k. i'm a tard.

yes, this is what you want to do OP. or script it if your naming structure isn't just based on usernames.
 
Back
Top