Customizing Default User Profiles with ZENworks
Novell Cool Solutions: Tip
By Phillip E. Thomas
Digg This -
Posted: 10 May 2006
ENVIRONMENT: Script tested on Windows XP SP2, but the default user profile works the same way on Windows NT Workstation 4.0 and Windows 2000.
PROBLEM: Many Windows settings are located in the HKEY_CURRENT_USER hive in the registry. Since each new user on a Windows machine gets their own copy of the HKCU hive, it's problematical to control and maintain these settings. It's possible to use force-run, distribute-always applications to push these settings, but it would be preferable to have customized settings become defaults for the system.
In order to do this, you have to modify the default user registry hive. Each new user gets a copy of this hive as a starting point for building their own profile. The default profile on Windows XP is under C:\Documents and Settings\Default User.
Each time Windows boots, the Default User profile is loaded into HKEY_USERS\.Default. Changes made here will be active while the system is up, but since the hive is not written back to disk, changes are lost when the system reboots.
SOLUTION: The solution is to make changes within the C:\Documents and Settings\Default User\NTUser.dat registry hive file. Once this is done, all new users on the system will receive your customized settings. This can be done manually for inclusion in a workstation image, or can be scripted and pushed with a ZENworks application.
To manually edit the file, run regedit.exe. Highlight the HKEY_LOCAL_MACHINE hive. On the File menu, choose Load Hive, and browse for C:\Documents and Settings\Default User\NTUser.dat. When prompted for a Key Name, write something like Temphive. Now you have loaded the default user hive into the registry, and can make your desired changes to subkeys and values under HKEY_LOCAL_MACHINE\Temphive. When finished, highlight Temphive with the mouse, and choose Unload Hive from the File Menu. This writes the NTUser.dat file back to disk, including any changes.
Scripting this solution with the built-in Windows XP commands reg.exe and regedit.exe is illustrated below with a customization of redirecting the Internet Explorer search function to Google.
EXAMPLE: First, create a text file named "gogl.reg" containing:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Temphive\Software\Microsoft\Internet Explorer\Main] "Use Search Asst"="no" "Search Page"="http://www.google.com" "Search Bar"="http://www.google.com/ie" [HKEY_LOCAL_MACHINE\Temphive\Software\Microsoft\Internet Explorer\SearchURL] ""="http://www.google.com/keyword/%s" "provider"="gogl" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Search] "SearchAssistant"="http://www.google.com/ie"
Then, create a text file named goglsrch.cmd containing:
copy gogl.reg "C:\Documents and Settings\Default User" c: cd "\Documents and Settings\Default User" if errorlevel 1 goto End reg load HKLM\Temphive NTUser.dat if errorlevel 1 goto End regedit /s gogl.reg reg unload HKLM\Temphive :End
Run the script, boot the PC to reload Default User\NTUser.dat into HKEY_USERS\.Default, and log in as a new user. This will not change existing user profiles.
If you have any questions you may contact Phillip at firstname.lastname@example.org
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com