Substitutions

 

Up







 

Just need it for one project?  Click here for Rental Options.

 

Lost Registration Code?  Click here.

Substitutions



Substitutions represent a very powerful new addition to Multi-Remote Registry Change. Using a simple form, you can set-up a virtually unlimited number of substitution items. Substitutions work by dynamically querying the registry of the target computer, and replacing the text you enter with the value contained at the specified location.

A Substitution item consists of:

Substitution Name: Any text, of any length, used to uniquely identify the substitution.

Substitution Location: The Hive, Key Name and Value Name of the value to be looked up.

Once you have defined a Substitution Item, you may enter the Substitution Name anywhere in any of the operations. The Substitution Name is case sensitive, and must be surrounded by the Substitution Delimiter you choose, the default is the ampersand (&).

A few facts about Substitutions
  • A substitution can point to any type of value, even binary values. All data types are converted to text during the lookup process, and then converted to the proper type during the application procedure.
  • Substitutions are recursive - you may use a substitution inside of another substitution, inside of another substitutions...
  • All operations support substitutions. Any place you can enter text, substitutions will work, even in REGEDIT4 formatted files.
  • Having large numbers of Substitution Items in the list has very little impact on performance.
  • Static Substitutions are applied before User Substitutions. To disable a Substitution, simply remove the check mark from its entry.
  • By default, if any substitution fails on a remote machine (because the location it is trying to find is not available, or because there is no current user, etc), then the entire transaction for the remote machine is aborted. The exception to this is the "Run Query Using Substitutions" option below.

    Now that those basics are out of the way, the best way to explain this is by example:

    Example 1: Change the logon banner to display your company specific text along with the computer name.

    1. Open the Substitutions dialog by selecting Substitutions - View/Change Substitutions from the main window.
    2. Enter "computername" in the box labeled 'Replace this text'
    3. Select HKEY_LOCAL_MACHINE for the Hive
    4. Enter "\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName" in the box labeled 'Key Path'
    5. Enter "ComputerName" in the box labeled 'Value Name'
    6. Click the 'Add/Update' button.

    The Substitution Entry is now complete

    Now to apply the text to all selected machines:

    1. Select the Single Key Operation.
    2. Hive: HKEY_LOCAL_MACHINE
    3. Key: \Software\Microsoft\Windows NT\CurrentVersion\Winlogon
    4. Value Name: LegalNoticeText
    5. Value Type: REG_SZ
    6. Value: You are logging on to Biggie Corp Computer: &computername&
    7. Click run to apply to all selected machines.

    Now, for example, the user logging on to computer "THOR" will see: "You are logging on to Biggie Corp Computer: THOR"

    Example 2: Change the default TCP/IP gateway.

    Because the TCP/IP parameters are stored as part of the network card parameters, changing the default gateway for a set of computers can be quite a problem.

    To start with, you need to know the name of the service of the primary network card:

    1. Open the Substitutions dialog by selecting Substitutions - View/Change Substitutions from the main window.
    2. Enter "PrimaryNetServiceName" in the box labeled 'Replace this text'
    3. Select HKEY_LOCAL_MACHINE for the Hive
    4. Enter "\Software\Microsoft\Windows NT\CurrentVersion\NetworkCard\1 in the box labeled 'Key Path'
    5. Enter "ServiceName" in the box labeled 'Value Name'
    6. Click the 'Add/Update' button.

    To change the Default Gateway:

    1. Select the Single Key Operation
    2. Hive: HKEY_LOCAL_MACHINE
    3. Key: \SYSTEM\Services\&PrimaryNetServiceName&\Parameters\TCPIP
    4. Value Name: DefaultGateway
    5. Value Type: REG_MULTI_SZ
    6. Value: 123.234.235.1
    7. Click run to apply to all selected machines.

    Example 3: Backup a value before changing it.

    For obvious reasons, sometimes it is imperative that you be able to create a backup of a key before you change it. This example illustrates using a Substitution within a Substitution, and assumes you have created the Substitution in Example 2. To backup a value before changing it:

    For example, to backup the TCP/IP address before changing it:

    1. Open the Substitutions dialog by selecting Substitutions - View/Change Substitutions from the main window.
    2. Enter "OldIP" in the box labeled 'Replace this text'
    3. Select HKEY_LOCAL_MACHINE for the Hive
    4. Enter : '\SYSTEM\Services\&PrimaryNetServiceName&\Parameters\TCPIP' in the box labeled 'Key Path'
    5. Enter "IPAddress" in the box labeled 'Value Name'
    6. Click the 'Add/Update' button.

    To change the copy the old IP Address to another value:

    1. Select the Single Key Operation.
    2. Hive: HKEY_LOCAL_MACHINE
    3. Key: \SYSTEM\Services\&PrimaryNetServiceName&\Parameters\TCPIP
    4. Value Name: OldIPAddress
    5. Value Type: REG_MULTI_SZ
    6. Value: &OldIP&
    7. Click run to apply to all selected machines.


    Then, if the value must be restored, create a new substitution entry that points to the Value Named 'OldIPAddress'

    1. Open the Substitutions dialog by selecting Substitutions - View/Change Substitutions from the main window.
    2. Enter "RestoreIP" in the box labeled 'Replace this text'
    3. Select HKEY_LOCAL_MACHINE for the Hive
    4. Enter : '\SYSTEM\Services\&PrimaryNetServiceName&\Parameters\TCPIP' in the box labeled 'Key Path'
    5. Enter "OldIPAddress" in the box labeled 'Value Name'
    6. Click the 'Add/Update' button

    To restore the value to its original location:

    1. Select the Single Key Operation
    2. Hive: HKEY_LOCAL_MACHINE
    3. Key: \SYSTEM\Services\&PrimaryNetServiceName&\Parameters\TCPIP
    4. Value Name: IPAddress
    5. Value Type: REG_MULTI_SZ
    6. Value: &RestoreIP&
    7. Click run to apply to all selected machines.

    Although the examples above use only the Single Key Operation, Substitutions work equally well in all operations.

    Main Window
    Contents
    Run Query Using Substitutions
  • Copyright 1998-2006 Eytcheson Software
    All rights reserved.
    Last Updated:  Saturday, April 29, 2000