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 (by default, the NETLOGON share is /QIBM/UserData/OS400/NetServer/NetLogon for iSeries NetServer™) on the Logon Server. Special naming conventions must be followed for an iSeries 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. Assuming a user name of KRISTY, who is a member of the iSeries Primary Group PCGROUP.

  1. If the file KRISTY.BAT (case does not matter for case insensitive file systems) 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.
Notes:
  1. Placing a new user or group logon script in the NETLOGON share is not guaranteed to be picked up by the user at the next logon without restarting iSeries NetServer 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 with the 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 iSeries called ADMINISTRA (10 char max), then the first logon script file checked for will be ADMINIST.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%.

The following 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%\%username% 

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