Building a New DIRSYNC Instance

The information used by DIRSYNC to execute its commands comes from one or both of the following sources:

Because DIRSYNC stores its configuration information in the registry, an instance name is generally used to give access to all the parameters in that instance. This instance name points to a location in the registry where the DIRSYNC configuration information is stored. If you specify an instance by its name only, DIRSYNC will look for its data in the following registry key:

HKEY-LOCAL-MACHINE\SOFTWARE\MS EXCHANGE SAMPLES\DIRSYNC\<instance-name>

The instance name is not necessary if all required information is supplied on the command line, or if the /KEY command-line flag is used to point to a registry key where instance data is stored.

You can use the the Windows NT Registry to create and view instances, or you can run DIRSYNC with the /SET command-line flag. If you use the /SET flag, parameters entered from the command line are copied into the registry, but the requested operation is not performed. Without the /SET flag, DIRSYNC creates a transient instance that uses command-line flags, but does not update the registry.

If you have not used the /SET flag, have not included all the information on the command line, and type an instance name that does not exist in the registry, DIRSYNC prompts you to create a new instance. If you answer Y, DIRSYNC writes to the registry key, but performs no operation — as if you had used the /SET flag. Answering N to this question exits the program.

    To build DIRSYNC
  1. Change to the directory containing the DIRSYNC source files:

    \BKOFFICE\SAMPLES\EXCHANGE\DIRSYNC

  2. Type NMAKE.

The following procedure shows how to set up a new instance of DIRSYNC without using the /SET command-line flag and with /SET.

    To set up a new DIRSYNC instance in the Registry
  1. Choose a name for your new instance.
  2. Type DIRSYNC and the instance name:

    DirSync <instance name>

    If you type the following command and use an unknown instance name, DIRSYNC displays this message:

    The instance <Instance-Name> is unknown. Create a new instance? (Y/N)
     
  3. Type Y in response.

    If you type N, DIRSYNC terminates immediately. If you type Y, DIRSYNC creates the new registry keys and all the default values, exits, and displays the following message:

    New NT Registry key created for instance HR-Database:
    HKEY_LOCAL_MACHINE\SOFTWARE\EDK Samples\DIRSYNC\<Instance-Name> 
     
  4. Display and change the required and optional parameters for this instance as you prefer by editing the registry keys as shown below. Spaces are allowed within instance names, as long as the command-line parameter is surrounded by quotes. For example: DIRSYNC "Instance Name With Spaces."
    To set up a new DIRSYNC instance with the /SET command
  1. Type in all parameters to be set for the new instance and the /SET parameter. For example:

    DIRSYNC <instance name> /SET /EXPORT /SITEDN=/O=ORGANIZATION/OU=SITE
    /CONTAINER=Recipients /DSA=server1 /EXPLIST=
    Obj-Class,Common-Name,Display-Name,
    USN-Changed/EXPFILE=C:\EXPORT.OUT

  2. Verify that the instance has been created by editing the Windows NT Registry as shown in the next procedure.

    To display and edit the new DIRSYNC instance
  1. Choose Windows NT Diagnostics from the Administrative Tools group.
  2. Choose Registry Editor from the Tools menu in the dialog box. Several windows representing Windows NT Registry keys appear.
  3. From the HKEY_LOCAL_MACHINE on Local Machine window, choose SOFTWARE. Choose Microsoft Exchange Server SDK Samples\DIRSYNC and click once.
  4. Click the directory icon for your new instance. All registry keys with their current values appear. Check that all the keys are correctly set.