Link to home
Start Free TrialLog in
Avatar of Peter_Fabri
Peter_Fabri

asked on

Setting up users with drives

I think I can set up server drives so that my workstation can see them when logged on as a user. Is there a more efficient way of setting up a folder for each user by using %username% as a parameter so that when each user logs on to my workstation, they see their private/shared drive?

Peter
Avatar of Pete Long
Pete Long
Flag of United Kingdom of Great Britain and Northern Ireland image

Yes you need to put

IF NOT EXIST h: then net use h:\\server\share /y
IF NOT EXIST h:\%username% then MD h:\%username%

in your login scripts

This will map drive letter H to the users home drive (called their username)

You can run a batch file at either Startup or shutdown (or Logon/Logoff) from the Local Security Policy

CLick Start >Run > type "gpedit.msc" {enter}

Navigate to the following location


Local Computer Policy >Computer Configuration >Windows Settings >Scripts

OR

Local Computer Policy >User Configuration >Windows Settings >Scripts

In both locations you will see a set of scripts in the USER settings you set scripts for LOGON and LOGOFF. In the COMPUTER settings you will see scripts for STARTUP and SHUTDOWN


Add your .bat file to the appropriate script.

Or if you have a DOMAIN you can put it in the Domain login script

Pete
Avatar of Peter_Fabri
Peter_Fabri

ASKER

I'm a bit confused about script and .bat files. How do they differ and how important are they?

Can I easily access my script files, say from the OS? I know a path was outlined above, but this seems to suggest I need to be in the command prompt rather than the OS.

My server is a domain controller, if this makes explaining any easier. Also, is there a format this files must have?

Sorry if I'm being a bit dense here, but it's the first time i am doing this sort of thing at home.

Peter
ASKER CERTIFIED SOLUTION
Avatar of Joseph Nyaema
Joseph Nyaema
Flag of Kenya image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Once the you have saved the script in the NetLogon directory.

Enter the  name of the Batch file or Script in the Logon Script field on the Profile Tab of the users properties in active directory
What is the "y" for in the above batch file? I have created a MapHome.Bat file and saved it in the shared folder c:\WinNT\SysVol\scripts in my domain Controller and then entered the name of this file in the Logon script field on the Profile tab of one of my users. What should I now expect to see?

Peter
if you mean the /y on the end of the net use command it meane "Persistent" i.e. the mappint will be there after a reboot
I still need some clarification. The advice above regarding creating a batch file, is that all the commands I need? And should I be naming the files after the  users rather than MapHome.bat in the logon script field?
 
Looking at some example .bat files, one begins

@echo off

Net Use /PERSISTENT:NO > NUL

Net time \\server /set /yes

Echo connecting drives please wait........
@echo off

Net use p:\\server\user$
net use g:\\server\public  

etc


Echo Thanks for your patience !!

I should be most grateful if further help and explanations could be offered regarding batch files.

Peter

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Will the above work for W2K in a domain environment? or is there a different procedure?

Peter
It will work in a 2K domain, though its traditional to apply login scripts ot an OU level in a domain :)
ThanQ