Computing.Net > Forums > Windows 2000 > Logon Scripts

Logon Scripts

Reply to Message Icon

Original Message
Name: Ran
Date: July 20, 2001 at 06:55:41 Pacific
Subject: Logon Scripts
Comment:

How do I implement a logon script from Win2k.
I have Win98 wkstations logging on the the Win2k Domain and I need to map drives on the workstations. Any Ideas on how I can get this job done without mapping each individual machine with static mappings?


Report Offensive Message For Removal

Response Number 1
Name: mike
Date: July 20, 2001 at 06:59:40 Pacific
Subject: Logon Scripts
Reply: (edit)

same as NT, bat file in the user profile.


Report Offensive Follow Up For Removal

Response Number 2
Name: Ran
Date: July 20, 2001 at 07:23:44 Pacific
Subject: Logon Scripts
Reply: (edit)

I tried to put in a bat file through user profile but The drive does not map after logon. Do you have an example of a bat file?
I even tried to run net use on the workstation but it state an error 50?
Hel[


Report Offensive Follow Up For Removal

Response Number 3
Name: Michael Ward
Date: July 20, 2001 at 07:31:27 Pacific
Subject: Logon Scripts
Reply: (edit)

Ran,

This is quite simple.... if you want to map drives you just make a batch file for each user and use the command:

NET USE H: \\Servername\Sharename


( This is an example where it would map that share as the H: You can use any letter you want )
You can also just list as many as you want.

Another thing you may want to consider is adding a time synchronization command to the batch and, if practical, mapping the printers so anytime someone needs a printer added you can just modify the batch file at the server and the next time they log on it will all be there.

To map printers all you do is put the con2prt.exe file in the \Winnt\ directory on each client. Below is an example of how it should look.

REM Map All Network Drives Relevant to Specific User
REM ************************************************
NET USE H: \\Servername\Share1
NET USE L: \\Servername\Share2
NET USE N: \\Servername\Share3
NET USE P: \\Servername\Share4
NET USE W: \\Servername\Share5
NET USE S: \\Servername\Share6

REM Map All Printers Relevant to Specific User & Location
REM *****************************************************
CON2PRT/f
CON2PRT/c \\Servername\PrinterShareName1
CON2PRT/c \\Servername\PrinterShareName2
CON2PRT/c \\Servername\PrinterShareName3
CON2PRT/cd \\Servername\PrinterShareName4

REM Synchronize Time on All Workstation with Primary Domain Controller
REM ******************************************************************
NET TIME \\Servername /SET /Y

Note that with the con2prt function the following apply

con2prt /f = flush all printers... this wipes a clean slate.
con2prt /c = connect to printer
con2prt /cd = connect to printer and set as default... you'll obviously only want one.
In the example above all 4 printers would be installed and printer 4 would be the default.

Save this as a batch file, usually the username . bat, (ie. johndoe.bat, janedoe.bat), then put them in the
WINNT\SYSVOL\DOMAIN\SCRIPTS folder.

Then go in AD Users and Computers... choose a user, go into properties, go to the Profile tab, and type in the name of the batch file (ie. johndoe.bat) There is no need to include a path.

AD may take a few minutes to replicate these shares throughout the Domain. The next time the user logs on all the drives and printers will be mapped and the system time of the server and the client will be identical which is great for AD.

If anyone reads this and wants a copy of the con2prt file just email me.

-Mike Ward, MCSE, MCP+I, CCNA


Report Offensive Follow Up For Removal

Response Number 4
Name: Michael Ward
Date: July 20, 2001 at 07:38:22 Pacific
Subject: Logon Scripts
Reply: (edit)

Ran,

I forgot to mention that on the profiles tab your typing in the name of the batch file in the "logon script" field.. not the "profile" field.

Just in case you were unsure.

-Mike


Report Offensive Follow Up For Removal

Response Number 5
Name: Ran
Date: July 20, 2001 at 08:43:13 Pacific
Subject: Logon Scripts
Reply: (edit)

Mike Your recommendation worked except.
The Login with the time sync just sits there executing on the workstation and never finishes. If I rem the time sync out of the batch file the mappings does not take place.
If I type the net use at the console prompt of the workstation the drive mapps perfect.
Any ideas?


Report Offensive Follow Up For Removal


Response Number 6
Name: Michael Ward
Date: July 20, 2001 at 09:12:20 Pacific
Subject: Logon Scripts
Reply: (edit)

Make sure the Time service is running in "Services". The mapping should work regardless of whether or not the time function is in there.... I'll look into it a little further for you.

-Mike


Report Offensive Follow Up For Removal

Response Number 7
Name: Michael Ward
Date: July 20, 2001 at 09:18:20 Pacific
Subject: Logon Scripts
Reply: (edit)

Ran,

The time service is called "Windows Time"


Report Offensive Follow Up For Removal

Response Number 8
Name: Ran
Date: July 20, 2001 at 10:44:42 Pacific
Subject: Logon Scripts
Reply: (edit)

The Windows NT Logon Script pop-up appears on the Win98 wkstation it states:
Please wait while your logon script executes.

This message just sites there for about 5min

Then the desktop appears and im My Computer the Mapped Drive does not appear.


Report Offensive Follow Up For Removal

Response Number 9
Name: Ran
Date: July 20, 2001 at 10:58:58 Pacific
Subject: Logon Scripts
Reply: (edit)

Actually the time is forever not 5 min. Until you press cancel.

If you execute the net use and the net time commands at the dos prompt of the wkstation everything works.

Please Help


Report Offensive Follow Up For Removal

Response Number 10
Name: Mike Ward
Date: July 20, 2001 at 12:54:25 Pacific
Subject: Logon Scripts
Reply: (edit)

Ran,

Did you include the con2prt function in your batch file?

If so, did you put con2prt.exe in the Windows directory?


Report Offensive Follow Up For Removal

Response Number 11
Name: franck
Date: July 24, 2001 at 00:09:47 Pacific
Subject: Logon Scripts
Reply: (edit)

Hello,

I have an additionnal question:
How do you do , if you want to know if the user is in a group or not.
Thank you in Advance


Report Offensive Follow Up For Removal

Response Number 12
Name: Blan8370
Date: July 24, 2001 at 15:20:05 Pacific
Subject: Logon Scripts
Reply: (edit)

Franck,
goto start>settings>control panel>administrative tools>computer management>then expand Local Users and Groups>goto users>doubleklick on a user>goto 2nd tab "member of".
That's all

Greetz


Report Offensive Follow Up For Removal

Response Number 13
Name: Paul Vickers
Date: September 17, 2001 at 04:13:38 Pacific
Subject: Logon Scripts
Reply: (edit)

Re: con2prt

We are currently testing with Win2k with a locked down image. i.e. a user does not have full control to all files. Does anyone know which files/directories a user needs write/change/full/whatever access to in order to work woth con2prt?


Cheers


Report Offensive Follow Up For Removal

Response Number 14
Name: Irina Profir
Date: September 18, 2001 at 02:43:52 Pacific
Subject: Logon Scripts
Reply: (edit)

Hi,
Does somebody know how to hide the Windows NT logon script box "Pleas wait while login script executes"?
Or at least how to hide cancel button ?


Report Offensive Follow Up For Removal

Response Number 15
Name: Jared Price
Date: September 19, 2001 at 13:16:05 Pacific
Subject: Logon Scripts
Reply: (edit)

I have a problem similar to Ran's problem. I tried to add three lines to the end of my logon script batch file which will update the virus definitions (McAfee) on the client machines when the user logs on. The server is running windowsNT and the clients are all win 98. When I add these three lines...

f:
cd\library\mcafee\superd~1
sdat4160.exe /silent /f

...it causes the logon screen to pause on the client and all it says is...

"Please wait while your logon script executes"

...It stays on this screen forever or until you click cancel. The weird thing is the actual update of the virus definitions worked, but it just froze afterwards. I was wondering if anyone could give any advice or if there is a command that will break out of the logon script after the virus definitions update.

Thx


Report Offensive Follow Up For Removal

Response Number 16
Name: Jared Price
Date: September 19, 2001 at 13:20:47 Pacific
Subject: Logon Scripts
Reply: (edit)

By the way... here is the full logon script that doesn't work in case anyone needed more info. If I take the last three lines off, everything runs fine except that I can't update the virus definitions.

@echo off
net use f: /d
net use u: /d
net use f: \\matrixsbs\data
net use u: \\matrixsbs\users
net time \\matrixsbs /set /yes

f:
cd\library\mcafee\superd~1
sdat4160.exe /f



Report Offensive Follow Up For Removal

Response Number 17
Name: imstillatwork
Date: September 26, 2001 at 11:28:17 Pacific
Subject: Logon Scripts
Reply: (edit)

Here is what I have been using. I make one for each department. (I generally sepreate managment into their own 'department') It basicaly forces drives to be mapped how I want, and uniform on all clients. (about 150 users)

__________________________________
rem G: will be the first Mapped Network Drive on Clients.

:E
CLS
if exist E: goto DELE
GOTO F
:DELE
net use e: /delete

:F
CLS
if exist f: goto DELF
GOTO L
:DELF
net use f: /delete

rem Drives G-K are Mapped below....
rem e,f, l-z are forced delete on boot.

:L
CLS
if exist l: goto DELL
GOTO M
:DELE
net use l: /delete

*****
on and on and on finaly to Z....
*****
:z
CLS
if exist z: goto DELz
GOTO G
:DELz
net use z: /delete

rem Users folder on G:

:g
CLS
if not exist g: goto MAPG
net use g: /delete
:MAPG
net use g: \\vcom\vol7 /persistent:no

:H
CLS
if not exist h: goto MAPH
net use h: /delete
:MAPH
net use h: \\vcom\vol8 /persistent:no

:I
CLS
if not exist i: goto MAPI
net use i: /delete
:MAPI
net use i: \\vcom\vol9 /persistent:no

:J
CLS
if not exist j: goto MAPJ
net use j: /delete
:MAPJ
net use j: \\vcom\vol2 /persistent:no

:K
CLS
if not exist k: goto MAPK
net use k: /delete
:MAPK
net use k: \\vcom\vol3 /persistent:no


Goto Done


:END
CLS
Exit

:DONE
CLS
@echo off
echo Drives Mapping Was a Success!!

Pause
Goto end


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Logon Scripts

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software