Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP 9000 Networking: Supervising the Network > Chapter 5 Customizing the User Environment

Examples of Login Scripts

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

The following examples of login scripts may help you plan your own container, profile, and user login scripts. Each example login script is shown in a table.

The left column of each table shows the commands in the login script. The right column explains the command's purpose.

For instructions on creating login scripts, see "Creating or Modifying a Login Script Using NetWare Administrator" or "Creating or Modifying a Login Script Using NETADMIN" in this chapter.

Default Login Script

The default login script executes the first time User object ADMIN logs in. It also executes for any users who do not have user login scripts.

You can't modify the default login script because it is coded into the LOGIN utility. Instead, you can create container, profile, or user login scripts.

Table 5-7 lists the content of the default login script.

Table 5-7 Default Login Script

Login Script Command

Purpose

MAP DISPLAY OFF

Prevents map commands from displaying on the screen.

MAP ERRORS OFF

Prevents mapping errors from displaying on the screen.

MAP *1:=SYS:

Maps the first drive to volume SYS:.

MAP *1:=SYS:%LOGIN_NAME

Maps the first drive to the user's home directory if LOGIN_NAME is the same as the user's home directory. If the user has no home directory, the first drive is still mapped to SYS:.

IF "%1"="ADMIN" THEN MAP *1:=SYS:SYSTEM

If the login name is ADMIN, the first drive is mapped to SYS:SYSTEM instead of the user's home directory.

MAP P:=SYS:PUBLIC

If the user logs in from an OS/2 workstation, drive P: is mapped to SYS:PUBLIC.

If the user is not using an OS/2 workstation, this drive mapping is not included in the default login script.

MAP INS S1:=SYS:PUBLIC

MAP INS S2:=SYS:PUBLIC\

%MACHINE\%OS\%OS_VERSION

If the user is using a DOS or Windows workstation, the first search drive is mapped to SYS:PUBLIC, where DOS-based NetWare utilities are stored.

Then the second search drive is mapped to the directory where DOS is stored. (The two MAP commands are joined by a semicolon.)

If the user logs in from an OS/2 workstation, these drive mappings are not included in the default login script.

MAP DISPLAY ON

Allows MAP commands to display.

MAP

Displays a list of all drive mappings on the user's screen.

 

Container Login Script

The container login script should contain as much information as possible that applies to all users. An example is shown in Table 5-8.

Table 5-8 Sample Container Login Script

Login script command

Purpose

MAP DISPLAY OFF

Prevents MAP commands from displaying on the screen as they are assigned.

MAP ERRORS OFF

Prevents mapping errors from displaying on the screen.

MAP *1:=SYS:

Maps the first drive to volume SYS:.

MAP *1:=SYS:%LOGIN_NAME

Maps the first drive to the user's home directory if LOGIN_NAME is the same as the user's home directory. If the user has no home directory, the first drive is still mapped to SYS:.

IF "%1"="ADMIN" THEN MAP *1:=SYS:SYSTEM

If the login name is ADMIN, the first drive is mapped to SYS:SYSTEM instead of the user's home directory.

IF MEMBER OF "WIN31" THEN

MAP INS *2:=SYS:USERS\%LOGIN_NAME\WIN31

MAP INS S16:=SYS:APPS\WINAPPS\WIN31\

SET TEMP ="P:\uSERS\%LOGIN_NAME\

WIN31\

TEMP"

END

If the user who logs in is a member of the Group object WIN31, the next available drive is mapped to that user's Windows directory. Then the next available search drive is mapped to the Windows directory for the WIN31 group. Finally, the Windows TEMP directory is set to a subdirectory of the user's Windows directory.

MAP INS S16:=VOL1:APPL\WP

Maps the next available search drive to the directory that contains WordPerfect.

MAP INS S16:=VOL1:APPL\LOTUS

Maps the next available search drive to the directory that contains Lotus.

MAP INS S16:=SYS:EMAIL

Maps the next available search drive to the EMAIL directory.

IF MEMBER OF "MANAGERS" THEN

MAP *3:=VOL1:PROJECTS\REPORTS

END

If the user belongs to the Group object MANAGERS, the login script maps the third network drive to the REPORTS directory.

IF MEMBER OF "TESTERS" THEN

MAP *4:=INPUT:STATUS\uPDATES

END

If the user belongs to the Group object TESTERS, the login script maps the fourth network drive to the UPDATES directory.

COMSPEC=S2:COMMAND.COM

Sets COMSPEC to the DOS command processor, located in the DOS directory (in the second search drive).

SET PROMPT="$P$G"

Sets the prompt to display the user's current directory path followed by the ">" symbol.

MAP DISPLAY ON

Allows MAP commands to display.

MAP

Displays a list of all drive mappings.

WRITE

Displays a blank line between the list of mappings and following lines.

WRITE "Good %GREETING_TIME, %LAST_NAME."

Displays a greeting to the user. Example: "Good morning, SMITH."

WRITE "Your password expires in %PASSWORD_EXPIRES days."

Displays a message indicating the number of days before the user's password expires.

FIRE 3

Makes the phaser sound occur three times to tell the user that the login process is complete.

 

Profile Login Script

If you have groups of users with identical login script needs, you can create a Profile object, then create a login script for it. Then you can assign each user to be a member of that Profile object.

Table 5-9 shows an example of a profile login script you might create for users in the Profile object ACCOUNTING. This profile login script would execute after the container login script had executed.

Table 5-9 Sample Profile Login Script

Login script command

Purpose

MAP DISPLAY OFF

Prevents MAP commands from displaying on the screen as they are assigned.

MAP ERRORS OFF

Prevents mapping errors from displaying on the screen.

MAP INS S16:=VOL1:APPL\DB

Maps the first available search drive (after those assigned in the container login script) to the directory that contains the database program.

MAP *5:=VOL1:ACCOUNTS\NEW

Maps the fifth network drive (after those assigned in the container login script) to the NEW subdirectory.

MAP *6:=VOL1:ACCOUNTS\RECORDS

Maps the sixth network drive (after those assigned in the container login script) to the RECORDS subdirectory.

#WSUPDATE S1:IPXODI.COM /LOCAL

Executes WSUPDATE which updates the IPXODI.COM file on the user's workstation with a new version of the file located in the first search drive.

MAP DISPLAY ON

Allows MAP commands to display.

MAP

Displays a list of all drive mappings.

WRITE

Displays a blank line between the list of mappings and following lines.

IF DAY_OF_WEEK="FRIDAY" THEN WRITE "Weekly progress report is due today" FIRE 2 END

On Fridays, the phaser sound occurs twice to alert the user while the message "Weekly progress report is due today" displays on the screen.

PCCOMPATIBLE EXIT "NMENU WORK"

Stops the profile login script and sends the user into a menu program called WORK. EXIT also prevents any user login scripts from executing. If you want a user login script to execute after the profile login script, put these lines at the end of the user login script instead. (DOS workstations with the machine name IBM_PC do not need the PCCOMPATIBLE line.)

 

User Login Script

Table 5-10 shows an example of a user login script for user Mary. The user login script executes after the container and profile login scripts have executed.

Table 5-10 Sample User Login Script

Login script command

Purpose

MAP DISPLAY OFF

Prevents MAP commands from displaying on the screen as they are assigned.

MAP ERRORS OFF

Prevents mapping errors from displaying on the screen.

MAP *7:=VOL1:MARY\PROJECTS\RESEARCH

Maps Mary's seventh network drive (after those assigned in the container and profile login scripts) to the RESEARCH subdirectory in her home directory.

MAP *8:=VOL1:FORMS

Maps Mary's eighth network drive (after those assigned in the container and profile login scripts) to the FORMS directory.

REM Mary needs access to FORMS while she's on the REM troubleshooting team. Remove the driver mapping REM when Mary is reassigned.

This remark is intended as a reminder to the person who created the login script. This remark isn't displayed on the user's screen. (Because the remark is several lines long, each line starts with REM.)

SET WP="/u-mjr/b-5"

Sets Mary's environment variables for her word-processing application.

SET USR="mrichard"

Sets Mary's username (mrichard) for the electronic mail program.

#CAPTURE Q=FAST_Q NB TI=10 NFF

Executes the CAPTURE utility so Mary can print from non-network applications.

PCCOMPATIBLE EXIT "NMENU TRAINING"

Stops the user login script and sends the user into a menu program called TRAINING. (DOS stations with the machine name IBM_PC don't need the PCCOMPATIBLE line.)

 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.