Setting Up Login Scripts

When a user successfully logs in to the network, one or more login scripts are executed which automatically set up the workstation environment. Login scripts are similar to batch files and are executed by the Novell® LOGIN utility.

You can use login scripts to map drives and search drives to directories, display messages, set environment variables, and execute programs or menus.

Login scripts are properties of specific NDS® objects.

There are four types of login scripts:

Maintaining many user login scripts can be time consuming. Therefore, you should try to include as much customization information as possible in the container and profile login scripts, which are fewer in number and easier to maintain.

For example, if all users need access to the NetWare utilities in the same volume, put the search drive mapping to that volume in a single container login script rather than in every user login script.

Create profile login scripts if several users have identical login script needs. Profile login scripts are sometimes thought of as group login scripts.

Finally, in user login scripts, include only those individual items that can't be included in profile or container login scripts.

IMPORTANT:  Because up to three login scripts can execute whenever a user logs in, conflicts can occur and drive mappings can be overwritten by consecutive login scripts. It is important to note that the last login script to execute (usually the user login script) overrides any conflicting commands in a previous login script.

HINT:  In Windows NT and Windows 2000, all drive mappings created using NetWare LOGIN are root mapped. Because of this, programs cannot access directories above the directory that the drive is mapped to. If necessary, you can turn off the default by adding SET MAPROOTOFF="1" as the first line in the login script. This will globally force all NT/2000 workstations using the login script to not map root drives.

WARNING:  Don't delete the login directory (SYS:LOGIN) created during network installation. It contains the Novell LOGIN and NLIST utilities. If users run command line utilities, they can use these utilities to log in and view a list of available NetWare servers.


Where Login Scripts Should Be Located

Login scripts are properties of objects. Consequently, only certain objects can contain login scripts. This, in turn, largely determines where login scripts can be located.

The following figure shows how the different types of login scripts can reside in an NDS tree and how they affect users.


Where different types of login scripts can reside

In the figure, there are three users: ESAYERS, SWILLIAMS, and MRICHARD. The following explains which login scripts execute when each of these users logs in:

Container login scripts affect only users immediately below the Organization or Organizational Unit that contains the login script.

For example, in the previous figure, although there are two levels of container objects above users ESAYERS and SWILLIAMS, only the script for the container they're in (OU=SALES_PV) executes when they log in.

If the SALES_PV Organizational Unit had no container login script defined, no container login script would execute for ESAYERS and SWILLIAMS, even though a container login script exists at a higher level.

Because user SWILLIAMS has no user login script defined, the default login script executes after the container login script.

Because user MRICHARD belongs to the profile CLERKS, the CLERKS profile login script executes before MRICHARD's user login script. Users can be assigned to only one Profile object, but there are ways to get around this restriction. See Getting around the One Profile Login Script Restriction.


Creating or Modifying Login Scripts

You can use ConsoleOneTM to create login scripts from scratch or from a sample login script that is provided for you. Using a sample login script can help reduce syntax errors and thus reduce the time it takes to create login scripts.

All four types of login scripts use the same conventions, commands, and variables. For more information, see Login Script Commands and Variables.

The main difference in creating container, profile, and user login scripts is the object that you select to contain the login scripts. The default login script is not assigned to any object.

IMPORTANT:  Before you create or modify login scripts, you must have the Write property right to the object that will contain the login script. In addition, the Organization, Organizational Unit, Profile, or User object that you plan to assign the login script to must already exist.

To create or modify a login script using ConsoleOne, complete the following steps:

  1. Double-click the object whose login script you want to create or modify.

  2. Click Login Script.

  3. Enter the login script commands and information into the login script text box.

    For a sample, see Sample Login Scripts.

    IMPORTANT:  Make sure that you edit the sample login script to match the server names, directory paths, and specifications of your own network.

    For additional information on all login script commands, see Login Script Commands and Variables.

  4. To save the login script and close the Details dialog box, click OK.

    If the login script that you just created was a container or user login script, you're finished and the client software will be installed or updated the next time users log in.

    If the login script that you just created was for a Profile object, you must associate the User object with the Profile object and make the User object a trustee of the Profile object. See the next section, "Associating the User Object with a Profile Object."

    For additional information on all login scripts, see Creating or Modifying Login Scripts.


Associating the User Object with a Profile Object

  1. In ConsoleOne, double-click the User object that needs to use the profile login script.

  2. Click Login Script.

  3. Enter the name of the Profile object in the Default Profile field located under the login script text box, and then click OK.

  4. To add the User object as a trustee of the Profile object, double-click the Profile object.

  5. Click NDS Rights > Trustees of this Object > Add Trustee.

  6. Enter the name of the User object that uses this Profile object.

  7. Make sure that the Browse object and the Read property check boxes are checked, and then click OK to assign these rights to the User object.

    The User object is now a trustee of the Profile object and has the rights necessary to run the profile login script.

    Repeat these steps for all additional users who need to use this script.


Getting around the One Profile Login Script Restriction

Users can belong to only one profile login script and so, as a rule, only one profile login script can be executed for any user. There are ways to run the equivalent of different or multiple profile login scripts by specifying other profile login scripts.

For example, to specify a different profile login script for a user at the command line, use the following command:

LOGINW32 username /p profile_object

You can also specify a different profile login script using ConsoleOne. On the user's Login Script page, browse until you find the profile login script that you want to associate with the user, select it, and then click OK. For more information on associating a profile login script with a user, see the ConsoleOne help.

You can also assign users to more than one Group object. Use the MEMBER OF group identifier variable to execute different parts of a login script, depending on the Group objects that the user belongs to. To accomplish this, use the If...THEN command (see IF...THEN) and the MEMBER OF group identifier variable (see Using Identifier Variables).

To view an example of the IF...THEN command used with the MEMBER OF group identifier variable, see Sample Login Scripts.


Creating Login Scripts from a Sample or Existing Login Script

To create a login script from any of the samples included in this documentation or from an existing login script, complete the following steps:

  1. Locate the sample or existing login script that you want to modify.

    For sample login scripts included in this documentation, see Sample Login Scripts.

  2. Copy the sample or existing login script.

  3. In ConsoleOne, open the login script, copy the sample and then paste it into the login script.

  4. Make necessary changes to the sample login script to customize it for your network.

    IMPORTANT:  Make sure that you edit the sample login script to match the server names, directory paths, and specifications of your own network.

  5. Click OK to save the new login script.

    If the login script that you just created was a container or user login script, you're finished. If the login script that you just created was for a Profile object, you must associate the User object with the Profile object and make the User object a trustee of the Profile object. See Associating the User Object with a Profile Object.


Printing Login Scripts

To print a login script from the command line, use the NLIST command and redirect the output to a file or a printer. You must be in an object's parent container to see and print the login script of that object.

IMPORTANT:  You must have a workstation running DOS 3.30 or later and the Read and File Scan property rights to the object to be printed.

To print a user's login script, enter

NLIST user=username show "login script">LPT1

To print a container's login script, enter

NLIST "organizational unit"="ou name" show "login script">LPT1

NOTE:  Any option in the NLIST command that includes a space in its name must be enclosed in quotes.



Previous | Next