We have all had to work with software that requires certain settings to be adjusted while the software’s user is logged in to the system. This can be very frustrating when a system is used by more than one user. To keep from having to revisit a workstation multiple times, you need to make sure that no matter who logs on to the system, they have this registry setting in their profile. Using the NT 4 Resource Kit utility REG.EXE along with SMS Installer you can accomplish this.
Understanding how user profiles interact with the registry is key to making effective use of this script. One common misconception is that making changes to the [KHEY_USERS\.DEFAULT] key will make the changes to the Default User profile. This is not the case. The [.DEFAULT] key actually governs the state of the computer when no user is logged in. If you want a certain background bitmap to appear behind the Ctrl + Alt + Delete screen, set the Wallpaper value in [HKEY_USERS\.DEFAULT\Control Panel\Desktop]. The rest of the keys under [HKEY_USERS] represent the registry hives of the local Administrator account, the currently logged in user, and any service accounts currently being used to run services.
The registry settings for the Default User profile are actually stored in the NTUSER.DAT file in the Default User profile folder. To create a custom Default User profile, log in to a system and customize your profile settings. Then use the System Properties applet to copy the profile to the Default User directory. This effectively copies the NTUSER.DAT file from your profile to the Default User directory.
When a user logs on to a system the user’s registry hive is loaded from the NTUSER.DAT file located in their profile directory to a key represented by the user’s SID under [HKEY_USERS]. If the user has never logged on to the system before, a copy of NTUSER.DAT from the Default User profile is loaded for that user. When the user logs off of the system, the [HKEY_USERS\SID] registry key disappears and all of the user-specific registry settings are stored in the NTUSER.DAT file in the user’s profile directory.
In order to modify a user-specific registry setting for an existing profile or the Default User, you can use REG.EXE from the NT 4 Resource Kit. REG.EXE allows you to load a stored registry hive, make changes to it, then save it back to a flat file. While the documented syntax does allow you to update or add values I found it very problematic. Instead I use REG.EXE’s Open, Save, and Close syntax along with SMS Installer’s Edit Registry functions to make the changes.
This SMS Installer script creates a text file with a list of the paths to each existing profile by searching for and renaming each ntuser.ini file on the system. This file exists in every profile folder except Default User. The Default User profile location is pulled from the registry and placed into the text file also.
C:\Documents and Settings\amybanford
C:\Documents and Settings\Administrator
C:\Documents and Settings\SMSCliSvcAcct&
C:\Documents and Settings\SMSCliToknAcct&
C:\Documents and Settings\Default User
The script then reads each line of the text file and loads and changes each profile’s registry hive. This script should be executed by SMS when no user is logged on to a system. An NTUSER.DAT file that is in use cannot be loaded. Therefore, the script does not try to load the hive if the profile path contains “SMS” because the SMSCliSvcAcct& account is used to execute advertised programs with SMS.
2152AllUserReg.ipf