Microsoft KB Archive/319529

= How to Modify the Control Script for Running Batch Files =

Article ID: 319529

Article Last Modified on 5/28/2003

-

APPLIES TO


 * Microsoft Metadirectory Services 2.1
 * Microsoft Metadirectory Services 2.2 Service Pack 1
 * Microsoft Metadirectory Services 2.2 Service Pack 1

-



This article was previously published under Q319529



SUMMARY
Running the Microsoft Metadirectory Services (MMS) management agents (MAs) by using the Schedule MA tool may not provide the flexibility that you want for running separate phases. This article describes how to modify the control script for running batch files.



MORE INFORMATION
By default, MAs run with the options that you set by using Compass. Compass is the MMS client. You may want to change the settings or to make sure that specific options are consistently set before you run a particular phase. This functionality is not included in the default capabilities of the MMS MAs. However, you can make some changes so that the MAs run from the command line by using batch files to expand their flexibility. Note that this technique does not prevent you from using the MMS schedule functionality.

If you use the method that is described in this article, you can set operational parameters in the MA control script and trigger them by using a command-line variable. This method prevents someone from accidentally changing the Operate MA parameters, which can cause unintended results. In particular, it is important to be able to force the MA mode to the correct value.

To use this method, you modify the MA control script to override the variables that you typically set in the graphical user interface (GUI). To edit the template:
 * 1) Log on to MMS as an administrator by using Compass.
 * 2) Click Bookmarks in the left pane, and then click Management Agents.
 * 3) In the right pane, click the appropriate MA.
 * 4) Click Actions in the left pane, and then click Design MA.
 * 5) Click the Control MA Operations tab.
 * 6) Click the MA Control Script tab.
 * 7) Edit the template code.
 * 8) To save the changes, click OK.

You can determine the variable names that are linked to Compass input fields by pausing the mouse pointer over a field in the GUI, and then holding down the CTRL key while you right-click the item. A ToolTip that contains the attribute name appears.

The following sample code contains an If-Then statement. This statement is evaluated if you set the command-line Action variable to IMPORT. This example is from a Microsoft Exchange LDAP MA. Note that the variables are specific to the MA that you are using. IF %Action% = IMPORT THEN SET zcDsRole = &quot;reflector&quot; SET zcDsPerformDiscovery = &quot;TRUE&quot; SET zcDsPerformMetaSync = &quot;TRUE&quot; SET zcDsPerformUpdateCD = &quot;FALSE&quot; SET zcMAProcessHierarchicalStructure = &quot;TRUE&quot; SET zcMAProcessUsers = &quot;TRUE&quot; SET zcMAProcessLists = &quot;TRUE&quot; SET zcDsPerformInTestMode = &quot;FALSE&quot; SET zcDSPerformForeignUpdates = &quot;FALSE&quot; SET zcDSImportDelta = &quot;FALSE&quot; SET zcDSExportDelta = &quot;FALSE&quot; SET zcExchangeExcludeCustomRecipients = &quot;TRUE&quot; SET zcDSLogTransactions = &quot;TRUE&quot; SET zcDSImportUsesTransactionStack = &quot;FALSE&quot; SET zcDSAttributeFlowChanges = &quot;TRUE&quot; SET zcDSMAMaximumEntriesToProcess = &quot;&quot; ENDIF After you prepare the MA control script to evaluate the run-time parameters and you set the MA variables, a command-line call can trigger the appropriate behavior. For example, a sample command line to run an MA that is named MyMA might be:
 * 1) Custom Action definition for command-line support

c:\zoomserv\bin\zscript -dn &quot;ma=MyMA,DsaName=MMS01,ou=Applications,dc=company,dc=com&quot; -define &quot;Action=IMPORT&quot;

Note that the MMS server name is embedded in the control script (in this case, DsaName=MMS01).

Note that zcDsRole, which controls the mode, accepts reflector, link, and creator.

You can enter the command line in the Schedule tool's Command window. The MA operates according to both the defined schedule and the expanded command-line options.

Additional query words: zoomit

Keywords: kbinfo kbenv KB319529

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.