12.12 RegistrySet

Use this Knowledge Script to set or create a Windows registry key. You can specify a list of computers where you want to set the key value, either directly using the List of computers parameter or in a file containing a list of computer names or addresses. This script creates a new key if the specified key does not exist. In addition, this script raises an event if the set operation fails. This script can also raise an event if the set operation completes successfully.

On 64-bit Windows systems, you can configure this script to set registry information for 32-bit or 64-bit programs.

  • To set registry information for a 64-bit application, disable the Set 32-bit program registry keys on a 64-bit system? parameter and specify the registry path and key under HKEY_LOCAL_MACHINE\Software.

  • To set registry information for a 32-bit application, enable the Set 32‑bit program registry keys on a 64-bit system? parameter and specify the registry path and key exactly as it would be specified on a 32-bit system, under HKEY_LOCAL_MACHINE\Software.

12.12.1 Resource Objects

Windows 2003 Server or later

12.12.2 Default Schedule

The default interval for this script is Run once.

12.12.3 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

Event when set?

Set to y to raise an event when the registry key is set successfully. The default is n.

Set 32-bit program registry keys on a 64-bit system?

On a 64-bit Windows system, set this parameter to y to set registry information for 32-bit programs. The default value, n, enables you to set registry information for 64-bit programs. On a 32-bit Windows system, this parameter is not applicable and will be ignored.

Tip To set registry information for 32-bit programs and 64-bit programs, configure separate jobs.

Root key

Specify the registry root. Valid root options are:

  • HKEY_LOCAL_MACHINE

  • HKEY_CLASSES_ROOT

  • HKEY_CURRENT_USER

  • HKEY_USERS

The default is HKEY_LOCAL_MACHINE.

Full path to registry key

Provide the full path to the registry key. You can enter any path under the root key as long as you have write permission.

The default path is: Software\NetIQ\AppManager\4.0\NetIQmc\Tracing

To specify the path to the registry key for a 32-bit or 64-bit program, specify a path under HKEY_LOCAL_MACHINE\Software.

NOTE:Although the registry keys for 32-bit programs on a 64-bit system are stored under the key HKEY_LOCAL_MACHINE\Software\Wow6432Node, do not specify the Wow6432Node component of the path. Instead, specify the path without the Wow6432Node component, and enable the Set 32-bit program registry keys on a 64-bit system? parameter.

Key name

Specify the name of the key to set or create. The default is TraceMC.

Key type

Specify the type for the key. Valid types are:

  • REG_SZ

  • REG_MULTI_SZ

  • REG_DWORD

  • REG_EXPAND_SZ

The default is REG_DWORD.

Value of the key

Specify the value to which the registry key should be set. Hex values can be entered in the form 0xnnnn. Default is 1.

NULL Character (Only for REG_MULTI_SZ)

Specify the character separator for REG_MULTI_SZ type. For example to set foo bar, you need to be able to indicate the blank space between foo and bar (foo+bar). The default is +.

NOTE:Choose a character that is not part of the name.

List of computers

Specify the computers for which you want to set this value. If you leave this parameter blank, the registry key located on the local computer is set.

To set the value for multiple computers, enter the hostname or IP address for each computer in a comma-separated list. For example:

CORP01,ENGR02,10.15.221.5.

Full path to file with list of computers

To set values for more computers than is convenient to enter one at a time in the List of computers parameter, create a file that contains a list of the computers you want to monitor.

Provide the full path to the file containing a list of the computers whose registry key values you want to set. The file should contain the hostname or IP address for each computer in one or more lines. Each line can have multiple computer names, separated by commas. For example:

NYC01,NYC02
SALES01,10.15.221.5,SFO01
LABMACH, QATEST

Severity: Key was set

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the key is set. The default is 16 (yellow event indicator).

Severity: Key was not set

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the key is not set. The default is 5 (red event indicator).