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!

logon script..mapping a drive depending on user. HELP! 1

Status
Not open for further replies.

neilparkes

IS-IT--Management
Nov 12, 2002
12
0
0
GB
Hi there.

I need to add into a logon script (win 2k sbs) to map a drive, only if one of the directors logs on. This is to give access to all users files. I could do this with 2 logon scripts..but I would like to try and get this working!

Unfortunatley the script is mapping this drive whatever user logs on!

What I have added is:

ECHO CONNECTING PRIVATE DRIVES
NET USE G: \\SBSERVER\USERS\%USERNAME% /YES >NUL
IF %USERNAME% == ADMINISTRATOR GOTO :DD
IF %USERNAME% == MARK GOTO :DD
IF %USERNAME% == KEVIN GOTO :DD
IF %USERNAME% == MIKE GOTO :DD

:DD
NET USE S: \\SBSERVER\ALL_USERS /YES >NUL
:DD

ECHO OK

All workstations are Win2k Pro. Any ideas why this isnt working? Any help greatly appreciated.

Regards,
 
Try using IFMEMBER from the resource kit. I use it on many of my servers. Very easy. You would have to setup groups.

Jeremy
 
Sorry....made a typo.

:DD
NET USE S: \\SBSERVER\ALL_USERS /YES >NUL
:DD

should be

:DD
NET USE S: \\SBSERVER\ALL_USERS /YES >NUL
:END

Neil
 
You need a "GOTO End" between "IF %USERNAME% == MIKE GOTO :DD" and ":DD".

Without that, everyone will end up at ":DD" regardless of thier username.

Also, just for the sake of clarity, you don't need the colon in the GOTO statement. For example "IF %USERNAME% == MIKE GOTO DD" will work and is neater to look at.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top