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 - half way done

Status
Not open for further replies.

katchme

MIS
May 5, 2003
23
0
0
US
Hi all,

I already setup a logon script to map users to certain drive if they are part of a certain group. However, I can't get 1 user to access 2 drives from 2 different department at the same time. Could you please help. Below is the script I've done:

***********
:departmenta
ifmember departmenta
if not errorlevel 1 goto departmentb
ECHO Mapping departmenta...
IF EXIST I:\NUL NET USE I: /DELETE > NUL
NET USE I: \\server\WORKGROUP\DEPARTMENTA /PERSISTENT:NO > NUL
goto NEXT

:departmentb
ifmember departmentb
if not errorlevel 1 goto departmentc
ECHO Mapping departmentb...
IF EXIST J:\NUL NET USE J: /DELETE > NUL
NET USE J: \\server\WORKGROUP\DEPARTMENTB /PERSISTENT:NO > NUL
goto NEXT

:departmentc
ifmember departmentc
if not errorlevel 1 goto NEXT
ECHO Mapping departmentc...
IF EXIST K:\NUL NET USE K: /DELETE > NUL
NET USE K: \\server\WORKGROUP\DEPARTMENTC /PERSISTENT:NO > NUL
goto NEXT

:NEXT

REM ***DEFAULT DRIVE MAPPINGS

net use g: /delete
net use g: \\servername\%clientname%

net use q: /delete
net use Q: \\servername\ivfpms

net use s: /delete
net use s: \\servername\workgroup\share

END

************

Question:

1) What additional command do I need to put in this script so that if I add the person to 2 different groups in Windows 2000 server, when they logon they would get both drive e.g. drive I and J, departmenta and departmentb, respectively.

Many thanks to those that help.

katchme!






 
Remove all the lines that say "goto Next"

Cheers,
Sam

Please let members know if you found their posts helpful.
 
katchme,

FYI, I also posted a WSH example to do the same thing. My example is written in JScript which would allow you to take it far further, i.e. using COM to power it from databases etc.

thread96-539674

-- Regards,
Tim Scarfe <tim [at] developer-x .com>
.developer-x. com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top