Troubleshooting and Configuring the Windows NT/95 Registry
-9-Making Manual Changes to the Registry Using REGEDT32.EXEYou just got off the phone with Microsoft technical support, having waited on hold for what seemed like an eternity. The support representative referenced a KnowledgeBase article Q-seven million or something like that, and told you that you need to edit the Registry and make a change to one of the keys. In every instance when Microsoft recommends editing the Registry, they put in a warning/disclaimer reminding you of the fragile nature of the Registry, and urge you to back it up before continuing. So, before you continue, back up the Registry now! Editing the RegistryThe Windows NT Registry Editor is REGEDT32.EXE, located in the \WINNT\SYSTEM32 directory. There is no icon or menu item in the Start menus on purpose. With an icon or a menu item, users would be more likely to edit the Registry, creating significantly more work for the administrators of the network. The limitations of who can use the Registry Editor are different, depending on whether you are connected to a domain. If you are not connected to a domain, logging on as Administrator to your local machine will allow you to edit the Registry. To edit the Registry of a domain-connected NT system, you must be a member of either the Administrators or Power Users group, or from a trusted domain who has been granted access to those groups. Starting the Registry EditorUsually, the easiest way to start the Registry Editor is to launch it from the Start-Run dialog box. Simply type REGEDT32 and press Enter. There is no need to enter the directory path because the directory is automatically in the environment variables. At launch, you'll see the screen shown in Figure 9.1. Figure 9.1. Cascading windows of REGEDT32.EXE.
For each handle key window, the left pane in the screen shown in Figure 9.2 shows the keys and subkeys (considered the same for this discussion). They are organized in expandable branches. Any branch that has subkeys is shown with a plus (+) sign in the folder icon. Double-clicking the folder expands the branch. After the branch has been expanded, the plus sign is replaced with a minus (-) sign, indicating that the branch may be collapsed.
Figure 9.2. REGEDT32.EXE with expanded and collapsed folders.
Start with the most common function in Registry editing: editing a current entry in the Registry. Figure 9.3. REGEDT32.EXE value syntax.
Figure 9.4. Read Only Mode warning in REGEDT32.EXE.
Editing Registry ValuesTo edit a value, double-click it. Double-clicking invokes the proper editor. There is a separate editor for strings, including expandable strings (see Figure 9.5), multiple strings (see Figure 9.6), binary data (see Figure 9.7), and DWORD (see Figure 9.8). When you edit DWORD and binary information, you have additional choices to work in binary, hexadecimal, or decimal format. Figure 9.5. Editing data with the String Editor. Figure 9.6. Editing data with the Multi-String Editor. Figure 9.7. Editing data with the Binary Editor. Figure 9.8. Editing data with the DWORD Editor.
Quick Steps to Edit the RegistryFor easy reference, here is a list of steps to edit a value in the Registry:
Adding a Value to a Current KeyIf the value you need is not currently present, you can easily add one. All values are listed in alphabetical order, so it makes it easy to find them.
To add a value to a key, highlight the key, and select Edit | Add Value. Figure 9.9 shows the Add Value dialog box. You are prompted for the value name and data type. Figure 9.9. The Add Value dialog box in REGEDT32.EXE.
Most of the new entries you create are regular string values unless you specifically direct them to be otherwise. Finding a KeyIf you are not sure where the key is, you can locate it using View | Find Key. (See Figure 9.10.) The editor searches the Registry for the key name and moves your highlight there. However, it searches only in the current handle key, and only in the order listed in the dialog box. Figure 9.10. Finding a key with REGEDT32.EXE.
Figure 9.11. Unable to find a key with REGEDT32.EXE.
To extend the search capabilities of REGEDT32.EXE, use the shareware program REGSRCH.EXE, included on the CD-ROM with this book. Changing the Default Security of the RegistryBy default, the Registry can be edited only by members of the Administrators or Power Users groups. Each user in those groups, however, has equal access. To add users or groups, highlight the key and select Security | Permissions. Current permissions are shown in the resulting dialog box. (See Figure 9.12.) To change the current permissions of the groups or individual users, highlight the name and select the type of access in the dialog shown in Figure 9.13. Figure 9.12. Setting permissions with REGEDT32.EXE. Figure 9.13. Special access options with REGEDT32.EXE.
Registry PermissionsREGEDT32.EXE allows you to set permissions for individual users or groups to restrict access to the Registry. The standard permissions are Read and Full Control. Read access allows users to see the Registry entries, but not to change them. It is the default setting for the Everyone group. Full Control allows the user to read and change entries, including editing, adding, and deleting entries. It also includes permission to restrict other users from editing the Registry, and to take ownership of keys and subkeys. By taking ownership of a key with the Write Owner permission (included in Full Control), it is possible to determine who will be able to access the Registry, and in which way. For more specific settings and permissions, select Special Access as shown in
Figure 9.13. Table 9.1 shows the permissions and what they allow a user to do.
Determine what the security should be on keys and subkeys according to your organization's security policy. Then set those settings on the system through Security | Permissions.
Auditing Registry Usage, or Whos Been Eating My Porridge?The three bears wouldn't have wondered if they had auditing in place. With auditing, you can tell who has been editing the Registry, and whether those edits occurred locally or from a remote location. The person editing the Registry has no idea that he is being audited. There is no noticeable overhead or warning. Though you may have chosen the Everyone group to audit, the reporting of the audit is done individually. All results of the audit are posted in the security log in Event Viewer.
To activate auditing, select Security | Auditing, and add the groups or individuals
to be audited with the Add button. Then choose the success or failure of the action
to report. Figure 9.14 shows the Auditing dialog box, and Table 9.2 contains the
events that may be audited, and a short description of each.
Figure 9.14. Auditing access with REGEDT32.EXE.
The reporting of auditing results is done in the security log of the Event Viewer. Choose Event Viewer from the Administrative Tools menu, and select Log | Security. (See Figure 9.15.) Any successful items are shown with a key, and unsuccessful attempts are shown with a lock. Double-click the report line for additional details. (See Figure 9.16.) Figure 9.15. Results of auditing control in Event Viewer. Figure 9.16. Detail from an audit failure provides important security information.
Ownership of the Registry KeysAll Registry entries are owned by the Administrators group. The only reason to own a key or subkey is to select who can or cannot access the Registry. The critical reason that ownership transfer is available is to thwart damage, whether intentional or not, caused by the owner leaving the organization. If a user takes ownership of a key and its subkeys, that person has the right to determine who has access to it. Conceivably, that user could restrict all access to the key prior to leaving the organization. If no others had access to the data, reinstallation might be required to restore the capability to edit the data. However, regardless of the user, regardless of the restriction (even if the Administrator was given the No Access permission), it is impossible to prevent Administrator from taking ownership. That ability is fundamental in maintaining system security. The Administrator is the only one who can keep the data from going into a black hole, a location from which there is no return.
To take ownership of a key, highlight the key, select Security | Owner, and click Take Ownership. At that point, you have Full Control permissions and can choose to whom you want to grant or restrict access. Exporting the RegistryOccasionally, it would be nice to have the data in the Registry in a text format. You might use it to determine changes that are made that may not be easily found. For example, if you want to see the changes made when Control Panel options are exercised, you can take a snapshot of the current Registry using Registry | Save Subtree As and selecting the location and the file name. The data is then written into the file, and it can be read with any text editor or word processor. (See Figure 9.17.) Figure 9.17. Exported data from HKEY_CURRENT_USER\Control Panel.
Alternately, if two systems perform differently but are said to be set up in exactly the same way, you can use this tool to find out whether that is really the case. Usually, there are differences in the Registry that make the two systems work differently. Advanced Registry Editing OptionsAlthough Microsoft does not support it, they still include in REGEDT32.EXE the capability to export a section of the Registry to a file, edit the file, and put it back into the Registry. Generally, this is used by programmers to test the viability of proposed changes. Similarly, you can take a slice of a Registry from one machine and put it into another, overwriting the current Registry entries. I think it is obvious why this is not supported or encouraged by Microsoft. The misuse of this tool can be disastrous. Hardware information and software settings nearly always vary from system to system. However, if you are careful, you can use this to fix a system that is not currently correct. Be very careful. Proceed with extreme caution, and at your own risk. An example of when this tool would be very helpful is in the restoration of shares on the network after a server has crashed. Performing a full restore on top of a currently installed NT system restores the applications, data, and the file and directory permissions to a new server (in the same domain), but not the shares. Re-creating the shares manually may take a long time, and any errors mean the system is down even longer than anticipated. Rather than doing that, use the steps shown in the next section to restore the shares. (See Figure 9.18.) Figure 9.18. Using part of an old Registry to fix a new one.
Pulling the Shares from Another SystemThe step-by-step procedure for restoring the shares from another system is listed here for your convenience.
Editing Any Users SettingsOccasionally, it is necessary to load a Registry hive that is not normally opened in order to edit it. Such is the case with user settings, so you can edit the settings for any user even if he is not logged on to the network.
SummaryREGEDT32.EXE is an extremely powerful editor of the Registry. It provides required security, performance, and ease-of-use features that make it very popular. With proper use, you can edit any of the Registry safely, quickly, and effectively. You can use REGEDT32.EXE to make the everyday changes necessary for maintenance on your own system, and on others throughout the network. The features of security, loading additional hives, and saving and restoring keys makes it a particularly good choice for advanced system administrators. |
|||||||||||||||||||||||||||||||||||||||||||
|
|