
Transcription
Novell ConfidentialManual (ENU) 14 April 2004NovellLogin Scriptswww.novell.comLOGIN SCRIPTS GUIDEJune 2004
Novell ConfidentialManual (ENU) 14 April 2004Legal NoticesNovell, Inc. makes no representations or warranties with respect to the contents or use of this documentation, and specifically disclaims any expressor implied warranties of merchantability or fitness for any particular purpose. Further, Novell, Inc. reserves the right to revise this publication and tomake changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes.Further, Novell, Inc. makes no representations or warranties with respect to any software, and specifically disclaims any express or implied warrantiesof merchantability or fitness for any particular purpose. Further, Novell, Inc. reserves the right to make changes to any and all parts of Novell software,at any time, without any obligation to notify any person or entity of such changes.You may not export or re-export this product in violation of any applicable laws or regulations including, without limitation, U.S. export regulationsor the laws of the country in which you reside.Copyright 1993-2003 Novell, Inc. All rights reserved. No part of this publication may be reproduced, photocopied, stored on a retrieval system, ortransmitted without the express written consent of the publisher.U.S. Patent No. 5,157,663; 5,349,642; 5,455,932; 5,553,139; 5,553,143; 5,572,528; 5,594,863; 5,608,903;5,633,931; 5,652,854; 5,671,414;5,677,851; 5,692,129; 5,701,459; 5,717,912; 5,758,069; 5,758,344; 5,781,724; 5,781,733; 5,784,560; 5,787,439; 5,818,936; 5,828,882; 5,832,274;5,832,275; 5,832,483; 5,832,487; 5,859,978; 5,870,561; 5,870,739; 5,873,079; 5,878,415; 5,884,304; 5,893,118; 5,903,650; 5,903,720; 5,905,860;5,910,803; 5,913,025; 5,913,209; 5,915,253; 5,925,108; 5,933,503; 5,933,826; 5,946,002; 5,946,467; 5,956,718; 5,956,745; 5,964,872; 5,974,474;5,983,223; 5,983,234; 5,987,471; 5,991,810; 6,002,398; 6,014,667; 6,016,499; 6,023,586; 6,029,247; 6,052,724; 6,061,726; 6,061,740; 6,061,743;6,065,017; 6,081,774; 6,081,814; 6,094,672; 6,098,090; 6,105,062; 6,105,069; 6,105,132; 6,115,039; 6,119,122; 6,144,959; 6,151,688; 6,157,925;6,167,393; 6,173,289; 6,216,123; 6,219,652; 6,233,859; 6,247,149; 6,269,391; 6,286,010; 6,308,181; 6,314,520; 6,324,670; 6,338,112; 6,345,266;6,353,898; 6,424,976; 6,466,944; 6,477,583; 6,477,648; 6,484,186; 6,496,865; 6,510,450; 6,516,325; 6,519,610; 6,532,451; 6,532,491; 6,539,381;RE37,178. Patents Pending.Novell, Inc.1800 South Novell PlaceProvo, UT 84606U.S.A.www.novell.comNovell Login Scripts GuideDecember 22, 2003Online Documentation: To access the online documentation for this and other Novell products, and to get updates, seewww.novell.com/documentation.
Novell ConfidentialManual (ENU) 14 April 2004Novell TrademarksAppNotes is a registered trademark of Novell, Inc. in the United States and other countries.ConsoleOne is a registered trademark of Novell, Inc in the United States and other countries.eDirectory is a trademark of Novell, Inc.GroupWise is a registered trademark of Novell, Inc in the United States and other countries.NetWare is a registered trademark of Novell, Inc. in the United States and other countries.NetWare Mobile is a trademark of Novell, Inc.NetWare Requester is a trademark of Novell, Inc.Novell is a registered trademark of Novell, Inc. in the United States and other countries.Novell Client is a trademark of Novell, Inc.Novell Directory Services asnd NDS are registered trademarks of Novell, Inc. in the United States and other countries.Virtual Loadable Module and VLM are trademarks of Novell, Inc.ZENworks is a registered trademark of Novell, Inc in the United States and other countries.Third-Party TrademarksAll third-party trademarks are the property of their respective owners.
Novell ConfidentialManual (ENU) 14 April 2004
Novell ConfidentialManual (ENU) 14 April 2004Contents1Contents5About This Guide9Using Login Scripts11Login Script Overview . . . . . . . . . . . . . . . . . . . . .Where Login Scripts Should Be Located . . . . . . . . . . . .Common Login Script Commands . . . . . . . . . . . . . . .Creating or Modifying Login Scripts . . . . . . . . . . . . . .Creating or Modifying Login Scripts in iManager . . . . . .Creating or Modifying Login Scripts in ConsoleOne . . . .Getting Around the One Profile Login Script Restriction . .Creating Login Scripts from a Sample or Existing Login Script.Modifying User Login Scripts from the N Menu. . . . . . . . .Printing Login Scripts . . . . . . . . . . . . . . . . . . . . . .Understanding How Login Scripts Work with NetStorage . . .Additional Sources for Login Scripts Information . . . . . . . .2.Sample Login Scripts.Login Script Commands and VariablesLogin Script Conventions . . . . . . . . . . . .Using Identifier Variables . . . . . . . . . . . .Login Parameters with %n Variables . . . .Login Scripts Commands by Task . . . . . . .Network Connection and Resource Access.Login Script Execution . . . . . . . . . . .Workstation Environment . . . . . . . . . .Text File Usage . . . . . . . . . . . . . . .Other . . . . . . . . . . . . . . . . . . . .# . . . . . . . . . . . . . . . . . . . . . . . .Command Format . . . . . . . . . . . . . .Example . . . . . . . . . . . . . . . . . . [email protected] . . . . . . . . . . . . . . . . . . . . . . .Command Format . . . . . . . . . . . . . .Examples . . . . . . . . . . . . . . . . . .ATTACH . . . . . . . . . . . . . . . . . . . .BREAK . . . . . . . . . . . . . . . . . . . . .Command Format . . . . . . . . . . . . . .CONTEXT . . . . . . . . . . . . . . . . . . .Command Format . . . . . . . . . . . . . .11121313141516161718181921Sample Container Login Script . . . . . . . . . .Sample Profile Login Script . . . . . . . . . . . .Sample User Login Scripts . . . . . . . . . . . .Sample User Login Script for Mapping DrivesSample Default Login Script . . . . . . . . . . 333333343434345
Novell ConfidentialExample . . . . . . .DISPLAY . . . . . . . .Command Format . .Example . . . . . . .DRIVE . . . . . . . . . .Command Format . .Example . . . . . . .EXIT . . . . . . . . . . .FDISPLAY . . . . . . . .Command Format . .Examples . . . . . .FIRE or FIRE PHASERSCommand Format . .Examples . . . . . .GOTO . . . . . . . . . .Command Format . .Example . . . . . . .IF.THEN . . . . . . . .Command Format . .Examples . . . . . .INCLUDE . . . . . . . .Command Format . .Examples . . . . . .LASTLOGINTIME . . . .Command Format . .MAP . . . . . . . . . . .Command Format . .NO DEFAULT. . . . . .Command Format . .PAUSE . . . . . . . . .Command Format . .PROFILE . . . . . . . .Command Format . .Example . . . . . . .REMARK . . . . . . . .Command Format . .Example . . . . . . .SCRIPT SERVER. . . .Command Format . .SET . . . . . . . . . . .Command Format . .Examples . . . . . .SET TIME . . . . . . . .Command Format . .SHIFT . . . . . . . . . .Command Format . .Examples . . . . . .TERM . . . . . . . . . .Command Format . .Example . . . . . . .TREE . . . . . . . . . .Command Format . .WRITE . . . . . . . . . .Command Format . .Examples . . . . . .6Manual (ENU) 14 April 2004.Novell Login Scripts 4748484848495050
Novell Confidential4Manual (ENU) 14 April 2004Troubleshooting Login ScriptsLocating the Problem Statement in the Login Script . . . . . .Turning Off the MAPROOT Function in Windows NT/2000/XPOther Common Login Script Problems . . . . . . . . . . . . .Losing Path Statements after Login. . . . . . . . . . . . .Cannot Use the LOGIN and NLIST Utilities . . . . . . . . .Cannot Execute External Command . . . . . . . . . . . .LOGIN.EXE Problems . . . . . . . . . . . . . . . . . . .EXIT Command Doesn’t Work . . . . . . . . . . . . . . .Login Script Does Unexpected Things . . . . . . . . . . .51.Contents.5152525252525252537
Novell Confidential8Novell Login Scripts GuideManual (ENU) 14 April 2004
Novell ConfidentialManual (ENU) 14 April 2004About This GuideThis guide includes the following information on login scripts that can be used with Novell eDirectoryTM user accounts and Novell ClientTM software: Chapter 1, “Using Login Scripts,” on page 11 Chapter 2, “Sample Login Scripts,” on page 21 Chapter 3, “Login Script Commands and Variables,” on page 25 Chapter 4, “Troubleshooting Login Scripts,” on page 51Additional DocumentationFor documentation on installing and managing Novell Client software, see the Novell Client forWindows Installation and Administration Guide.Documentation UpdatesFor the latest version of this documentation, see the Novell Clients online documentation ndex.html).Documentation ConventionsIn this documentation, a greater-than symbol ( ) is used to separate actions within a step and itemswithin a cross-reference path.A trademark symbol ( , TM, etc.) denotes a Novell trademark. An asterisk (*) denotes a third-partytrademark.When a single pathname can be written with a backslash for some platforms or a forward slash forother platforms, the pathname is presented with a backslash. Users of platforms that require aforward slash, such as UNIX*, should use forward slashes as required by your software.About This Guide9
Novell Confidential10Novell Login Scripts GuideManual (ENU) 14 April 2004
Novell Confidential1Manual (ENU) 14 April 2004Using Login ScriptsThis chapter includes the following information: “Login Script Overview” on page 11 “Where Login Scripts Should Be Located” on page 12 “Common Login Script Commands” on page 13 “Creating or Modifying Login Scripts” on page 13 “Creating Login Scripts from a Sample or Existing Login Script” on page 16 “Modifying User Login Scripts from the N Menu” on page 17 “Printing Login Scripts” on page 18 “Understanding How Login Scripts Work with NetStorage” on page 18 “Additional Sources for Login Scripts Information” on page 19Login Script OverviewA login scripts is a set of instructions that is executed. A login script is simply a text file that thelogin executable (login.exe) interprets and runs line by line.When a user successfully logs in to the network, one or more login scripts are executed whichautomatically set up the workstation environment. Login scripts are similar to batch files and areexecuted by the Novell LOGIN utility.You can use login scripts to map drives and search drives to directories, display messages, setenvironment variables, and execute programs or menus.Login scripts are properties of specific eDirectoryTM objects.There are four types of login scripts: Container sets the general environments for all users in that container. Container login scriptsare executed first and can be associated with Organization or Organizational Unit objects. Auser can use only one container login script.NOTE: A container login script replaces the system login script from NetWare 3. Profile sets environments for several users at the same time. Profile login scripts are executedafter the container login script and are associated with Profile objects. A user can be assignedonly one profile login script but can choose other profile login scripts. User sets environments (such as printing options or an e-mail username) specific to a singleuser. User login scripts are executed after any container and profile login scripts and areassociated with User objects. A user can have only one user login script.Using Login Scripts11
Novell ConfidentialManual (ENU) 14 April 2004 Default contains only essential commands, such as drive mappings to NetWare utilities, andcannot be edited. The default login script runs if a user (including user Admin) doesn’t havea user login script, even if a container or profile login script exists.TIP: If you don’t want to create any user login scripts and you don’t want the default login script to executefor any users, you can disable the default login script by including the NO DEFAULT command in thecontainer or profile login script.Maintaining many user login scripts can be time consuming. Therefore, you should try to includeas much customization information as possible in the container and profile login scripts, which arefewer in number and easier to maintain.IMPORTANT: Because up to three login scripts can execute whenever a user logs in, conflicts can occur anddrive mappings can be overwritten by consecutive login scripts. It is important to note that the last login scriptto execute (usually the user login script) overrides any conflicting commands in a previous login script.For example, if all users need access to the NetWare utilities in the same volume, put the searchdrive mapping to that volume in a single container login script rather than in every user loginscript.Create profile login scripts if several users have identical login script needs. Profile login scriptsare sometimes thought of as group login scripts.Finally, in user login scripts, include only those individual items that can’t be included in profileor container login scripts. For example, personal drive mappings could be included in the userlogin script.Where Login Scripts Should Be LocatedLogin 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 eDirectory treeand how they affect users.[ROOT]Organization:Holds container script.Organizational Units:Hold container scripts.(O) Novell US(OU) Sales(OU) Accounting(OU) Sales PV(CN) MRICHARDUser:Holds user script.(CN) ESAYERS(CN) SWILLIAMS(CN) CLERKSProfile:Holds profile script.User:Holds user script.Belongs to “CLERKS”Profile object.In the figure, there are three users: ESAYERS, SWILLIAMS, and MRICHARD. The followingexplains which login scripts execute when each of these users logs in:12Novell Login Scripts Guide
Novell ConfidentialManual (ENU) 14 April 2004 User ESAYERS: The SALES PV container login script executes first, followed byESAYERS’s user login script. User SWILLIAMS: The SALES PV container login script executes first, followed by thedefault login script. User MRICHARD: The ACCOUNTING container login script executes, followed by theCLERKS’ profile login script, and then MRICHARD’s user login script.Container login scripts affect only users immediately below the Organization or OrganizationalUnit that contains the login script.For example, in the previous figure, although there are two levels of container objects above usersESAYERS 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 loginscript would execute for ESAYERS and SWILLIAMS, even though a container login script existsat a higher level.Because user SWILLIAMS has no user login script defined, the default login script executes afterthe container login script.Because user MRICHARD belongs to the profile CLERKS, the CLERKS profile login scriptexecutes 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 ScriptRestriction” on page 16.Common Login Script CommandsLogin scripts are powerful and can execute many different commands that you might find useful.However, the most common use for login scripts is mapping drives on NetWare servers. Thefollowing are the most common commands: MAP: Defines a path to a directory on a NetWare server. By putting a MAP command in thelogin script, the directory is automatically available to the user in My Computer. The driveletter can either be specified (MAP G: ) or can be relative (MAP *1 or MAP NEXT ). See“MAP” on page 41. IF.THEN: Gives statements of condition. For example, IF MEMBER OF “MANAGERS”THEN would execute the command that follows only if the user is a member of the Managersgroup. See “IF.THEN” on page 37. INCLUDE: Provides the name of an ANSI text file to be processed at a specific point in thelogin script. See “INCLUDE” on page 40. EXIT: Terminates all login script processing. EXIT is often used with IF.THEN statements.See “EXIT” on page 35.Information on these commands and others that you might find useful is provided in Chapter 3,“Login Script Commands and Variables,” on page 25.Creating or Modifying Login ScriptsYou can use Novell iManager or ConsoleOne to create login scripts from scratch or from asample login script that is provided for you. Using a sample login script can help reduce syntaxerrors and thus reduce the time it takes to create login scripts.Using Login Scripts13
Novell ConfidentialManual (ENU) 14 April 2004All four types of login scripts use the same conventions, commands, and variables. For moreinformation, see “Login Script Commands and Variables” on page 25.The main difference in creating container, profile, and user login scripts is the object that you selectto contain the login scripts. The default login script is not assigned to any object. Container login scripts are assigned to container objects (Organization or Organizational Unitobjects). Profile login scripts are assigned to Profile objects. In order for a User object to use a profilelogin script, you must select that User object and assign it to the Profile object. User login scripts are assigned to User objects.Before you create or modify login scripts, you must have the Write property right to the object thatwill contain the login script. In addition, the Organization, Organizational Unit, Profile, or Userobject that you plan to assign the login script to must already exist.Creating or Modifying Login Scripts in iManagerCreating or Modifying a User Login Script1 Click Roles and Tasks User Management Modify User.2 Specify a username and context, then click OK.3 Click General Login Script.4 Type the login script commands and information in the login script text box.For a sample, see “Sample Login Scripts” on page 21.IMPORTANT: Make sure that you edit the sample login script to match the server names, directorypaths, and specifications of your own network.For additional information on all login script commands, see “Login Script Commands andVariables” on page 25.5 (Conditional) To associate a Profile login script with this object, specify the Profile objectname and context in the Profile field.For additional information, see “Creating a Profile Login Script” on page 15.6 To save the login script, click OK.Creating a Container Login Script1 Click Roles and Tasks eDirectory Administration Modify Object.2 Specify the container and context, then click OK.3 Click General Login Script.4 Type the login script commands and information in the login script text box.For a sample, see “Sample Login Scripts” on page 21.IMPORTANT: Make sure that you edit the sample login script to match the server names, directorypaths, and specifications of your own network.For additional information on all login script commands, see “Login Script Commands andVariables” on page 25.14Novell Login Scripts Guide
Novell ConfidentialManual (ENU) 14 April 20045 (Optional) To associate a Profile login script with this object, specify the Profile object nameand context in the Profile field.For additional information, see “Creating a Profile Login Script” on page 15.6 To save the login script, click OK.Creating a Profile Login Script1 Click Roles and Tasks eDirectory Administration Create Object.2 Select Profile, then click OK.3 Specify the Profile name and context.4 Type the login script commands and information in the login script text box.For a sample, see “Sample Login Scripts” on page 21.IMPORTANT: Make sure that you edit the sample login script to match the server names, directorypaths, and specifications of your own network.For additional information on all login script commands, see “Login Script Commands andVariables” on page 25.5 Click OK OK.6 Click Roles and Tasks User Management Modify User.7 Specify a username and context, then click OK.8 On the General tab, click Login Script.9 In the Profile field, specify a profile name and context, then click OK.Creating or Modifying Login Scripts in ConsoleOne1 Double-click the object whose login script you want to create or modify.You can create this login script on a Container object, Profile object, or User object.2 Click Login Script.3 Type the login script commands and information in the login script text box.For a sample, see “Sample Login Scripts” on page 21.IMPORTANT: Make sure that you edit the sample login script to match the server names, directorypaths, and specifications of your own network.For additional information on all login script commands, see “Login Script Commands andVariables” on page 25.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 theclient 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 objectwith 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” onpage 13.Using Login Scripts15
Novell ConfidentialManual (ENU) 14 April 2004Associating the User Object with a Profile Object1 Double-click the User object that needs to use the profile login script.2 Click Login Script.3 Type the name of the Profile object in the Default Profile field located under the login scripttext box, then click OK.4 Add the User object as a trustee of the Profile object by double-clicking the Profile object.5 Click NDS Rights Trustees of This Object Add Trustee.6 Specify 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, then clickOK 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 theprofile login script.Repeat these steps for all additional users who need to use this script.Getting Around the One Profile Login Script RestrictionUsers can belong to only one profile login script and so, as a rule, only one profile login script canbe executed for any user. There are ways to run the equivalent of different or multiple profile loginscripts by specifying other profile login scripts.For example, to specify a different profile login script for a user at the command line, enter thefollowing:LOGINW32 username /p profile objectYou can also assign users to more than one Group object. Use the MEMBER OF group identifiervariable to execute different parts of a login script, depending on the Group objects that the userbelongs to. To accomplish this, use the If.THEN command (see “IF.THEN” on page 37) and theMEMBER OF group identifier variable (see “Using Identifier Variables” on page 27).To view an example of the IF.THEN command used with the MEMBER OF group identifiervariable, see “Sample Login Scripts” on page 21.Creating Login Scripts from a Sample or Existing Login Script1 Locate the sample or existing login script that you want to modify.For sample login scripts included in this documentation, see “Sample Login Scripts” onpage 21.2 Copy the sample or existing login script.3 In Novell iManager or ConsoleOne, open the login script, copy the sample, then paste it intothe User object or Profile object’s login script.See “Creating or Modifying Login Scripts” on page 13.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, directorypaths, and specifications of your own network.5 Click OK to save the new login script.16Novell Login Scripts Guide
Novell ConfidentialManual (ENU) 14 April 2004If the login script that you just created was a container or user login script, you’re finished. Ifthe login script that you just created was for a Profile object, you must associate the Userobject with the Profile object and make the User object a trustee of the Profile object. See“Creating a Profile Login Script” on page 15 or “Associating the User Object with a ProfileObject” on page 16.Modifying User Login Scripts from the N MenuIn addition to creating User login scripts in Novell iManager or ConsoleOne, you can also add userlogin scripts to User objects from the N menu in the system tray. This lets you customize the loginscript for the user that is currently logged in to the network without running iManager orConsoleOne.For example, users can add commands to their login scripts to map drives that they accessfrequently.1 Log in as the user you want to modify login scripts for.2 Right-click the N menu, then click User Administration for tree name Edit Login Script.3 Type the login script commands you want to add.If you want to map drives, you would typeMAP drive letter: \\server name\path to volumeFor example:MAP F: \\MKTG.TOKYO.DIGITALAIRLINE.COM\DOC4 Click OK.5 Click Yes to save changes to the login script.6 Log in again to see the changes to your login script.Using Login Scripts17
Novell ConfidentialManual (ENU) 14 April 2004Printing Login ScriptsTo print a login script from the command line, use the NLIST command and redirect the output toa file or a printer. You must be in an o
"Modifying User Login Scripts from the N Menu" on page 17 "Printing Login Scripts" on page 18 "Understanding How Login Scripts Work with NetStorage" on page 18 "Additional Sources for Login Scripts Information" on page 19 Login Script Overview A login scripts is a set of instructions that is executed.