This chapter discusses the purpose, syntax, and use of login scripts. You should be able to create a script of the proper sort after completing this chapter. The objectives important to this chapter are listed on page 6-1:
Key Concepts:Identify the Types of Login Scripts and How They InterrelateThere are four types of login scripts possible in NetWare 5.1. They are
listed on page 6-2:
The Default login script is actually part of the LOGIN.EXE program. It cannot be modified by the system administrator, so we will concentrate on the others. The diagram on page 6-2 is incorrect in one respect. If they exist, login scripts run in the order above: a Container script runs IF there is a container script for the container the user's object is in. A Profile script will then run, IF the user is assigned to a Profile. Finally, the User login script runs, if it exists. If the user has no login script, the Default login script will run, UNLESS the Container or Profile script contained the command "NO_DEFAULT". This command will keep the Default script from running for users. Novell recommends using only Container scripts, if possible. They run
for everyone who logs in to that container, and so, may be customized
for each container. Note the diagram on page 6-3:
Scripts are properties of NDS objects and can be created/edited in NetWare Administrator. Container login scripts are properties of the container. Profile login scripts are a property of a Profile object. While there can be multiple profiles in a system, only one Profile assignment is allowed for each user. A user must be made a Trustee of the Profile object and assigned the Read right to the Login Script property of the Profile. This is an NDS right, which is discussed in another chapter.. A User login script is a property of the User object. It runs after the other two, if they exist, and runs instead of the Default script if the User script exists. The Default login script, as noted above is part of the LOGIN.EXE program. Its main function is to map a drive to the PUBLIC directory. For this reason, if we avoid the default script, we must make sure that users are mapped to the PUBLIC directory in some other script. Design Login Scripts for Containers, Groups, and UsersAs in most NetWare activities, scripts should be planned from the top level down. Assign mappings that everyone needs in Container scripts, more specific things needed by groups in Profile scripts, and things needed by particular users in User scripts. Avoid unnecessary scripts, as they will need maintenance. You should review the suggestions on pages 6-6 through 6-8 for contents of the three types of editable scripts. Note that each set of recommendations ends with the comment that the administrator must take care not to write conflicting commands in scripts that might run sequentially. Configure the MAP Command in Login ScriptsThe MAP command is used in batch files (and login scripts) to tell the Novell Client where files are. A workstation may have access to various kinds of drives:
Local drive pointers may be any letters, but they are usually A: through D:. Search drive pointers fall at the end of the alphabet, and you may have up to sixteen of them. They are assigned from Z: backward. Network drives may be assigned to any letter not used already, as may search drives, so the system administrator must determine how many of each are really needed. In previous versions of NetWare is was not possible to map a search drive through the Windows interfaces (Windows Explorer, Network Neighborhood): now you can. The MAP command, when issued without modifiers, shows what the
current drive pointer assignments are. When used with modifiers,
the MAP command creates or modifies drive mappings. The basic syntax is: MAP G:=SERVER_VOLUMENAME: In this example, the pointer G: is assigned to point to the top of a
particular volume. The command may map to a particular directory
instead, such as the user's home directory. In this case, it is often
modified like this: MAP ROOT G:SERVER_VOLUMENAME:USERS\USERNAME This would have the effect of letting the user see files in this directory as though they were on his drive G:, and further, the keyword ROOT would prevent the user from using the CD (Change Directory) command to move any higher in the file structure. In this way, the system administrator lets the users see, modify and change their own directories, without easy access to other users' directories. More security is necessary to make this work, but that comes later in the text. When mapping a series of drive pointers, it may be easy to use
the syntax: MAP N SERVER_VOLUMENAME: This uses the letter N, without a colon or equal sign. N stands for Next, meaning "use the next letter". It is easy to make the workstation forget a drive mapping. Simply
use a command like this: MAP DEL G: This would cause the Novell Client to forget whatever mapping was currently assigned to G:. Search drive mappings are really an augmentation of the existing
PATH variable in the DOS/Windows environment. They serve the purpose of
telling the Novell Client where to look for executables that may not be
readily available. In order to understand, consider that when some object
is needed by a program or command, the workstation will look for it in
three stages (page 6-16 leaves out the first one):
Search drives are mappings that are added to the value of the Path variable. They are searched in order until the object sought is found, or there is no place left to search. Examples of search drive mappings appear on page 6-17. It is also possible to map a drive pointer to a Directory Map Object (DMO), as discussed on pages 6-18 and 6-19. This is easier, since some of the work is already done. When a system administrator creates a DMO, the path to a given volume or directory is stored as an attribute of the DMO. A user or assistant administrator only needs to know what DMO to use in a mapping command: they do not need to know where it actually points. Create and Execute Login ScriptsScript examples appear on pages 6-20 through 6-26, along with notes on the syntax of script commands. It is a bit different from other programming languages, but there are similiarities as well. The script may use certain variables (that are known to the system) to help carry out commands or to pass messages to the user. In the script, variable names are preceded with a percent sign, in order to use the value stored in that variable. You should review this section of the text to become familiar with syntax for the commands illustrated. Edit Login Scripts Using the LOGIN UtilityThe chapter says it ends with a discussion of "using the Login utility to edit scripts". This is not accurate. In the examples in the text, no script is being edited. What you are shown how to do is to choose what scripts will be run, or modify how a script will run. You can choose
These options are available from the Advanced section of the Novell Client Login screen. You should review these options as well as the syntax used in the script examples in the chapter. |