Novell Del Mar College
CIS 306 - Managing NOVELL® Networks
Instructor: Michael P. Harris
IntranetWare 4.11

IntranetWare Administration Guide

4. Using Login Scripts

Introduction

Use login scripts to connect your users' workstations to network resources whenever users log in to the network. With login scripts, you can

  • Map drives and search drives
  • Redirect print jobs to network print services
  • Display greetings or messages to the users' workstation screens
  • Set environment variables
  • Execute programs or menus at startup

This section provides basic information about creating and editing login scripts using the NovellŪ Easy Administration Tool (NEAT). If you need additional information, refer to the NetWare 4.11 online documentation included in this product.

Login Script Types

NetWare includes several types of login scripts. On an IntranetWare TM for Small Business network, you probably need to use only container and user scripts. For example, if you are using drive mappings with MAP and printer port redirection with CAPTURE (two uses of login scripts that are built in) on Windows 95* and NetWare ClientTM 32 for Windows*, editing the login scripts may be unnecessary.

Refer to the table that follows for a description of login script types.

Table 4-1. Login Script Types

Type
Description
Container
Runs first and provides global assignments for all users associated with the container (Organization object).
Default
Runs when a user script does not exist.
User
Runs last. Use it to customize the environment for a single user.
When a user is created in NEAT, mappings to the user's home directory and to the SYS:PUBLIC directory on the server are added to the user's login script.

We recommend using container scripts for company resources, such as printers and applications, in cases where every employee in the company needs access to them. We recommend using user scripts for users who need access to a specific application or other resource that other company employees do not need.

When a user logs in to the network, the container script commands run first. The user script commands run next and override any conflicting commands in the container login script. The user script is customized for each user and should be tailored to the user's needs.

Creating or Modifying a Login Script

You can access the login script through the NEAT utility.

Prerequisites

  • Log in to the network as ADMIN.
  • Double-click the NEAT icon.

Create or Modify a Container Script

Follow this procedure to create or change a container login script.

Procedure

  1. From the Directory view, select the Organization for which you are creating the script.

  2. From the General tab, click Edit Login Script .

    An "Edit Login Script" screen appears.

    Figure 4-1. Edit a Login Script



  3. NOTE: Review "Login Script Conventions" and "Login Script Commands" before continuing.

  4. Enter the login script commands for your users.

    If you are unfamiliar with login script commands, click the Help button for examples of commands that you can block, copy, and paste into your scripts. See "Create Login Scripts" in Help.

  5. Click OK to save the changes.

Example

MAP example. If you want all users to have easy access to the directory in which the WordPerfect* application is stored, you would press help, then block, copy, and paste one of the sample map commands into the login script as shown next.

Figure 4-2. Login Script Example



If the directory containing WordPerfect is located in APPS\WINAPPS\OFFICE \WP70 of your file system, you could modify the MAP command as follows:

MAP G:=ACME_SYS:APPS\WINAPPS\OFFICE\WP70

The G: specifies the drive to which you want to map the application.

If you change the home directory for a user, a new MAP command is added to the user's login script automatically.

For other uses of MAP, see "Directory and File Commands."

Table 4-2 shows examples of other script commands you can use in a container login script.

Table 4-2. Sample Container Login Script

Command
Description
REMARK This example is a login script.
This line is a comment that explains one or more lines in the script. Lines preceded by REM or REMARK, a semicolon (;), or an asterisk (*) do not display on the user's screen.
WRITE "Good %GREETING_TIME"
The command inside the quotation marks displays a message such as "Good Morning" when the user logs in.
MAP DISPLAY OFF
This line turns off the map display to the screen.
MAP INS S1:=ACME_SYS:PUBLIC
This line inserts a search drive mapping to the SYS:PUBLIC directory on server ACME.
MAP G:=ACME_SYS:APPS\WINAPPS\OFFICE\WP70
This line maps drive G: to the server directory containing the WordPerfect* application.
MAP N:=ACME_SYS:\APPS\WINAPPS\OFWIN
This line maps the next available drive to the server directory containing the GroupWise application. For example, if drives are already mapped to G:, this drive would be mapped to H:, the next available drive.
MAP INS S2:=ACME_SYS:PUBLIC\APPS\DB
This line maps to a database application.
COMSPEC=S2:COMMAND.COM
This line identifies the DOS COMMAND.COM file.
#CAPTURE S=NS1 P=LASERJET TI=10 NFF
This line captures (redirects) workstation print output and sends it to server NS1, then to the LaserJet* printer. Banners and form feeds are disabled.
DISPLAY ACME_SYS:ADMIN\MESSAGE.TXT
This line calls a text file MESSAGE.TXT which includes a greeting that displays when users log in to server ACME.
If the text you want to display is long, you can create a file and instruct Small Business to open the file on the screen.
PAUSE
This line inserts a pause in the execution of the login script so users can read messages that would otherwise scroll across the screen without stopping.
SET PROMPT=$p$g
This line sets a DOS environment variable that causes the drive letter (C:, for example) to display at the DOS prompt.

Create or Modify a User Script

To create or change a user login script, do the following.

Prerequisites

  • Log in to the network as ADMIN or a user who has rights to modify the user's login script.
  • Double-click the NEAT icon.

Procedure

  1. From the Directory view, select the user for whom you are creating the script.

  2. From the Property view, select the Login Script tab.

  3. Click Edit Login Script.

    The "Edit Login Script" screen appears. Commands that were added to the user's script when the user was created are displayed.

    Figure 4-3. Modify a Login Script



  4. Enter the desired login script commands for a user.

    NOTE: Review "Login Script Conventions" and "Login Script Commands" before continuing.

    If you are unfamiliar with login script commands, click the Help button for examples of commands that you can block, copy, and paste into your scripts. See "Create Login Scripts" in Help.

  5. Click OK to save the changes.



Login Script Conventions

Read the following guidelines before you add lines to login scripts.

Table 4-3. Login Script Conventions

Type
Description
Case
Use uppercase or lowercase characters.
Exception: Identifier variables (see "Login Script Identifier Variables") enclosed in quotation marks must be uppercase.
Characters per line
150 maximum; 78 characters across the screen.
Commands per line
One. Lines that wrap automatically are considered one line.
To end commands, press < Enter>. Begin subsequent commands on a new line.
WRITE commands display best if the command is repeated at the beginning of each wrapped line.
Punctuation and programming symbols
Type symbols (#, %, " ") and punctuation exactly as shown in the examples .
Sequence
ATTACH commands precede MAP commands.
Enter other commands in the order you want them to execute during login.
Group similar commands together to make them easier to read if sequence is not important.
Blank lines
These have no impact on login script execution. Use for visual separation if desired.
Semicolons (;), asterisks (*), REM[ARK]
These symbols are not interpreted as commands.
Placing any of these at the beginning of a command disables the command until the symbol is removed.



Login Script Commands

The following table summarizes commands you can use in login scripts.

Table 4-4. Login Script Commands

Command
Description
BREAK ON/OFF
Determines whether login script execution can be interrupted.
Format: BREAK ON|OFF
CLS
Clears the screen from the workstation at login.
Format: CLS
Example: C:> CLS
COMSPEC
Locates the COMMAND.COM (DOS) file for the computer and DOS version to be used after an application program is exited.
Format: COMSPEC=[ path] COMMAND.COM
Path is a drive letter or full directory path beginning with the volume name.
Example: COMSPEC=S2:COMMAND.COM
CONTEXT
Sets a user's current context in the Directory tree.
Format: CONTEXT context
Context is the context you want the user to see after login.
Example: CONTEXT .SALES.ACME_US
DISPLAY
Displays the text of a specified file on the screen.
Format: DISPLAY [ path] filename
Example: You have created some messages and saved them in a file. You want to access that file so you can display the messages to clients' screens.
IF DAY_OF_WEEK="MONDAY" THEN
DISPLAY SYS: PUBLIC\MESSAGES\SYSNEW.TXT
END
DOS BREAK
Controls whether programs or DOS can be interrupted by pressing <Ctrl> <Break> or <Ctrl> <C>.
Format: DOS BREAK [ON | OFF]
Example: DOS BREAK OFF
This turns <Break> off so a program cannot be interrupted using < Ctrl> <Break>.
DOS SET
Sets the DOS variable to a specified value.
Format: DOS SET
Example: DOS SET
DOS VERIFY
Ensures that data copied to a local drive is correct.
Format: DOS VERIFY [ON | OFF]
Example: DOS VERIFY ON
DRIVE
Specifies which drive is the default.
Format: DRIVE <drive letter>
Example: DRIVE S:
Returns the default drive letter of S: .
EXIT
Terminates the login procedure to allow users to access another file, program, or menu.
Format: EXIT [" filename [ parameters]"]
Example: EXIT "memo.txt"
This exits the login and returns the user to the memo.txt file.
# (EXTERNAL PROGRAM EXECUTION)
Allows users to execute a command that is external to the login script. Should not be used with terminate-and-stay-resident programs.
Format: # [ path] filename [ parameter]
Example: # COMMAND.COM /C CLS
This command goes out of the login script to run another command, such as command.com.
FIRE PHASERS
Produces a phaser sound at the workstation.
Format: FIRE n
Example: FIRE 10
This is an easy command to test. Add the number of times you want to hear the phaser, log out, log in, and listen.
GOTO
Executes a portion of the login script out of regular sequence.
Format: GOTO label
Label indicates where the login script should continue executing.
Example: GOTO DISPLAY ACME_SYS: ACCT\MESSAGE.TXT
This moves the script to display the message in MESSAGE.TXT.
IF...THEN
Sets conditions under which login commands will be executed. See "Login Script Identifier Variables" for examples.
INCLUDE
Accesses text files (subscripts) not usually included in the login script.
Format: INCLUDE [ path] filename
Example: IF MEMBER OF "MKTG" INCLUDE ACME_SYS:APPS\MEMO.TXT
This command goes outside the login script, finds a text file, and prints it to the screen. This is useful when a message is too long to place in the login script. You can also use an object name in place of a filename.
LASTLOGINTIME
Displays the last time a user logged in.
Format: LASTLOGINTIME
Example: LASTLOGINTIME
MACHINE
Specifies which computer (machine name) is being used for the workstation in question.
Format: MACHINE= name
Example: MACHINE=IBM_PS2
MAP
Maps a drive to a directory on the network.
Format: MAP [ option] [ drive:= path]
Example: MAP G:=ACME_SYS:APPS\WINAPPS
NO_DEFAULT
Does not allow the default user login script to run.
Format: NO_DEFAULT
Example: NO_DEFAULT
NOSWAP
Prevents the login utility from being moved out of conventional memory into higher memory.
Format: NOSWAP
Example: NOSWAP
PAUSE
Stops the login script execution until a key is pressed. (This allows users to read screen messages. )
Format: PAUSE
Example: PAUSE
PCCOMPATIBLE
Informs the login program that a machine is IBM-PC compatible.
Format: PCCOMPATIBLE
Example: PCCOMPATIBLE
REMARK
Allows users to insert descriptive comments (as opposed to commands) into the login script.
Format: REM[ARK] [ text]
You can also use * [ text] or ;[ text]
Example: REM This is a test script.
SET
Sets a DOS or OS/2* environment variable to a specified value.
Format: [TEMP] SET name=" value"
Example: SET PROMPT = "$P$G"
SWAP
Moves the LOGIN utility out of conventional memory and into high memory or onto the disk.
Format: SWAP [ path]
Replace path with either a drive letter or full directory path beginning with the NetWare volume name.
Example: SWAP ACME_SYS:APPS\WP70
TEMP SET
See SET.
WRITE
Writes the specified string on the screen during login. See "Login Script Identifier Variables" next.



Login Script Identifier Variables

The following table lists all the available identifier variables allowed in a login script. These variables are used with the login script commands to increase efficiency.

For example, the script

WRITE "Good %GREETING_TIME, %LOGIN_NAME"

could mean "Good Morning/Afternoon/Evening, Kim." The %GREETING_TIME and %LOGIN_NAME command are examples of identifier variables.

Table 4-5. Login Script Identifier Variables

Category
Identifier Variable
Function
Date
DAY
Day number (01 through 31)

DAY_OF_WEEK
Day of week (Monday, Tuesday, etc.)

MONTH
Month number (01 through 12)

MONTH_NAME
Month name (January, February, etc.)

NDAY_OF_WEEK
Day of week number (1 through 7; 1=Sunday)

SHORT_YEAR
Last two digits of year (94, 95, 96, etc.)

YEAR
All four digits of year (1994, 1995, 1996, etc.)
Time
AM_PM
Day or night (a.m. or p.m.)

GREETING_TIME
Time of day (morning, afternoon, or evening)

HOUR
Hour (12-hour scale; 1 through 12)

HOUR24
Hour (24-hour scale; 00 through 23; 00=midnight)

MINUTE
Minute (00 through 59)

SECOND
Second (00 through 59)
User
%CN
User's full login name as it exists in NDS

LOGIN_ALIAS_CONTEXT
"Y" IF REQUESTER_CONTEXT is an Alias. Use this if the user logs in using an alias login name.

FULL_NAME
User's unique username. It is the value of the FULL_NAME property for both NDS and bindery-based NetWare. Spaces are replaced with underscores.

LAST_NAME
User's last name (surname) in NDS, or full login name in bindery-based NetWare

LOGIN_CONTEXT
Context where user exists

LOGIN_NAME
User's unique login name (long names are truncated to eight characters)

MEMBER OF "group"
Group object that the user is assigned to

NOT MEMBER OF "group "
Group object that the user is not assigned to

PASSWORD_EXPIRES
Number of days before password expires

REQUESTER_CONTEXT
Context when login started

USER_ID
Number assigned to each user
Network
FILE_SERVER
NETWORK_ ADDRESS
NetWare server name
IPX external network number of the cabling system (8-digit hexadecimal number)
Workstation
MACHINE
Type of computer (IBM_PC, etc.)

NETWARE_REQUESTER
Version of the NetWare Requester for OS/2 or VLM users

OS
Type of operating system on the workstation (MSDOS, OS2, etc.)

OS_VERSION
Operating system version on the workstation (3.30, etc.)

P_STATION
Workstation's node number (12-digit hexadecimal)

PLATFORM
Workstation's operating system platform: DOS, OS2, WIN (Windows* 3.1), WNT (Windows NT*), or W95 (Windows 95*)

SHELL_TYPE
Version of the workstation's DOS shell (1.02, etc.); supports NetWare 2 and NetWare 3 shells and NetWare 4 Requester for DOS.

SMACHINE
Short machine name (IBM, etc.)

STATION
Workstation's connection number
DOS environment
variable
Any DOS environment variable can be used in angle brackets (path, etc.). To use a DOS environment variable in MAP, COMSPEC, and FIRE PHASERS commands, add a percent sign (%) in front of the variable. For example,
MAP S16:=%<path >
Miscellaneous
ACCESS_SERVER
Shows whether the access server is functional (TRUE= functional, FALSE=not functional)

ERROR_LEVEL
An error number (0=no errors)

%n
Replaced by parameters the user enters at the command line with the LOGIN utility
Object properties
property name
You can use property values of NDS objects as variables. Use the property values just as you do any other identifier variable. If the property value includes a space, enclose the name in quotation marks.
To use a property name with a space within a WRITE statement, place it at the end of the quoted string:
WRITE "Given name=%GIVEN_NAME"
IF "%MESSAGE SERVER"="MS1" THEN
MAP INS S16:=MS1\SYS :EMAIL



Additional Information

For More Information About
Go To
CAPTURE
"CAPTURE" in NetWare 4.11 Utilities Reference
Login scripts
"Login Scripts" in NetWare 4.11 Concepts
MAP
"Drive mapping" in NetWare 4.11 Concepts
"MAP" in NetWare 4.11 Utilities Reference
SET
"SET" in NetWare 4.11 Utilities Reference



[CIS 306] Prior       [Index] Main Index       [Next] Next      

[TOP of Page]     This page is maintained by:   Michael P. Harris

[Viking Home Page] viking.delmar.edu
Last Updated: Sep 20
[E-mail] mpharris@surf.delmar.edu
Copyright © 1998