Logon scripts

 

Logon scripts are DOS batch files that the client downloads and runs during the logon process.

Logon scripts are placed in the NETLOGON share on the logon server. By default, the NETLOGON share is /QIBM/UserData/OS400/NetServer/NetLogon for iSeries™ NetServer™. Special naming conventions must be followed for an i5/OS® logon server to report logon script file names to the client. The following steps are used by iSeries NetServer to determine the logon script name. Assume a user name of KRISTY, who is a member of the i5/OS Primary Group PCGROUP.

  1. If the file KRISTY.BAT (case does not matter for file systems that are not case sensitive) exists in the NETLOGON share, then that file is used as the logon script.

  2. Else if PCGROUP.BAT exists in the NETLOGON share, then that is used.

  3. Else the file name QZLSDEFT.BAT is used. If that file does not exist or is not accessible, then no logon script is processed.

If you do not restart iSeries NetServer after placing a new user or a group logon script in the NETLOGON share, the script might not be picked up by the user at the next logon. This is because this item is cached. However, performing a CHGUSRPRF command on a user (with or without options) will cause the cache to be updated during the next access and the new logon script should be found.

If the user is logging on from a PC by using the IBM Network Primary Logon Client (IPLC), that client is limited to DOS 8.3 logon script file names. For example, if the user logging on is administrator, and it matches a profile on the i5/OS operating system called ADMINISTRA (10-character maximum), then the first logon script file checked for is ADMINI .BAT.

Because many more environment variables are defined for Windows® 2000, and Windows XP, these platforms are capable of running more flexible logon scripts than the Windows 98 client. For example, from Windows NT® with service pack 4, the following environment variables are understood: %Homedrive%, %Homepath%, %Homeshare%, %OS%, %Userdomain%, %Username%, %Logonserver%, and %Processor_level%.

Here is an example of a logon script designed for users logging in from NT clients.

echo Logged into domain: %Userdomain%

echo Mapping X drive to personal share... 
net use x: %logonserver%\%userna % 

echo Mapping Y drive to operating system specific share... 
net use y: %logonserver%\%OS%  

echo Synchronizing PC time with the server net time %logonserver% /SET 
pause

 

Parent topic:

Domain logon support