The XML Configuration File - sorengranfeldt/marunscheduler GitHub Wiki

A sample XML input file, MARunScheduler.xml is provided with the download and you can modify this to fit your scheduling needs. Each XML file used with MARunScheduler can be configured differently and you can have many different schedules with different XML files.

MARunScheduler element

The MARunScheduler tag must be the root element of each configuration file.

<MARunScheduler Console="true" LogFile="MARunScheduler-{0:yyyyMMdd}.log" EnableLogging="true" WMITimeOutSeconds="30">`
  ...
</MARunScheduler>
  • LogFile: The attribute 'LogFile' to root element MARunScheduler is mandatory. The LogFile attribute value can be either an absolute path for the log file or just the log file name. You can have date and time inserted by using the {0} format provider, i.e. {0:yyyyMMdd} will be replaced by 2012-02-17 (for more options, please see http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx).
  • Console: The 'Console' attribute is mandatory and valid values for Console attribute are "true" and "false" (case-sensitive).
  • EnableLogging: This attribute specifies whether or not logging is done. You can set this to 'true' or 'false' (case-sensitive) to enable/disable logging.
  • LogDateTimeFormat: This optional attribute overrides the format of the timestamp from the system default (for more details, please see https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx).
  • WMITimeOutSeconds: Sets the global timeout value for WMI connection. This value is inherited to threads and items below, if these do not have their own WMITimeOutSeconds value set. Default value is 600 seconds (10 minutes). This option is valid for version 1.5 and later.

Thread element

At least one Thread element should be present within MARunScheduler.

<Thread LoopIndefinitely="false" RepeatCount="1" Name="AD" RunAfter="01:00" RunBefore="23:59" RunOnDays="Mon Tue Wed Thu Fri" WaitMinutes="0" WMITimeOutSeconds="30">
  ...
</Thread>
  • Name: The attribute 'Name' to the Thread is optional, however, it should be an alphanumeric value and should not start with a number.
  • RepeatCount: The 'RepeatCount' attribute value, however, is mandatory and should be a non-negative value in the range of 0 to 2,147,483,647. Specify RepeatCount="3" to Thread element, if you want to repeat the thread processing 3 times. If no RepeatCount is specified then the Thread will not be processed.
  • RunAfter/RunBefore: The attributes 'RunAfter' and 'RunBefore' (optional) allows you to specify a time interval where you want the run profiles in this thread to execute. If not specified, the thread will execute at all times. These options can be used to add more granularity in the same configuration file.
  • RunOnDays: This attribute allows you to specify which weekdays this thread executes. Valid day strings are three letter abbreviations, i.e. 'Sun' or 'Mon' or complete weekday names, i.e. 'Thursday' or 'Saturday'. You can specify multiple days, i.e. 'Mon Tue Fri'. If no value is specified the thread is executed on all weekdays.
  • LoopIndefinitely: The attribute 'LoopIndefinitely' can be set to 'true' to make a thread loop continuously until it's stopped / killed. This option is nice when you want to run against a system all the time. If you combine this with the Item option 'OnlyRunIfPendingExports', you can have a near real time export experience against a system. Setting this option to true, overrides the 'RepeatCount' option. Please note that configurations using this option can not use the ClearRunHistory (see below) also as thread will never finish and get to the clearing of run history.
  • WaitMinutes: The 'WaitMinutes' value (optional) should be a non-negative integer value in the range of 0 to 120 which pauses the thread between iterations.
  • WMITimeOutSeconds: Timeout value for WMI connection for this thread. This value is inherited to items below, if these do not have their own WMITimeOutSeconds value set. Default value is inherited from global setting. This option is valid for version 1.5 and later.

You can run another instance of MARunScheduler with a different configuration file if you want to combine the two.

Item element

At least one Item element should be present within a Thread. Each Item element specifies information on running on Run Profile.

<Item RunAfter="10:00" RunBefore="16:00" RunOnDays="Mon Fri" WMITimeOutSeconds="30">
  <Conditions Operator="And">
    <Condition xsi:type="Between" From="07:00" To="17:00" />
    <Condition xsi:type="SubCondition" Operator="And">
      <Condition xsi:type="WithinMinutesSpan" From="00" To="05" />
      <Condition xsi:type="WithinMinutesSpan" From="30" To="35" />
    </Condition>
  </Conditions>
  <Preprocessing>C:\Temp\Pre.cmd</Preprocessing>
  <PreprocessingArguments>/f:user</PreprocessingArguments>
  <MA>AD</MA>
  <RunProfile>DIDS</RunProfile>
  <WaitMinutes>0</WaitMinutes>
  <Postprocessing>C:\Temp\Post.cmd</Postprocessing>   <PostprocessingArguments>/f:computer</PostprocessingArguments>
  <ContinueOnFailure>true</ContinueOnFailure>
  <OnlyRunIfPendingImports>false</OnlyRunIfPendingImports>
  <OnlyRunIfPendingExports>false</OnlyRunIfPendingExports>
  <ThresholdLimits>
    <MaximumPendingImportAdds></MaximumPendingImportAdds>
    <MaximumPendingImportUpdates>/MaximumPendingImportUpdates>
    <MaximumPendingImportDeletes>10%</MaximumPendingImportDeletes>
    <MaximumPendingExportAdds></MaximumPendingExportAdds>
    <MaximumPendingExportUpdates></MaximumPendingExportUpdates>
    <MaximumPendingExportDeletes>100</MaximumPendingExportDeletes>
  </ThresholdLimits>
</Item>
  • RunAfter/RunBefore: The attributes 'RunAfter' and 'RunBefore' (optional) allows you to specify a time interval where you want this run profile to execute. If not specified, the profile will execute at all times. This option can be used to combine delta runs and full runs in the same configuration file and run these at different times throughout the day.
  • RunOnDays: This attribute allows you to specify which weekdays this run profile should execute. Valid day strings are three letter abbreviations, i.e. 'Sun' or 'Mon' or complete weekday names, i.e. 'Thursday' or 'Saturday'. You can specify multiple days, i.e. 'Mon Tue Fri'. If no value is specified the run profile is executed on all weekdays.
  • WaitMinutes: The 'WaitMinutes' value should be a non-negative integer value in the range of 0 to 120. This value is mandatory for each item.
  • MA: The 'MA' should specify a valid MA name. This is mandatory for each item.
  • RunProfile: The 'RunProfile' value can be any value which is acceptable to Forefront Identity Manager and should specify a valid Run Profile name associated with the MA name. This value is optional for each item.
  • OnlyRunIfPendingImports: The 'OnlyRunIfPendingImports' value specifies whether only to run the profile if there are any pending imports for the specified MA (set to "true" and "false" (case-sensitive)). This option is valid for version 1.3 and later.
  • OnlyRunIfPendingExports: The 'OnlyRunIfPendingExports' value specifies whether only to run the profile if there are any pending exports for the specified MA (set to "true" and "false" (case-sensitive)).
  • Preprocessing: The 'Preprocessing' value can specify the command/application to be executed before the MA run profile execution. This value is optional.
  • PreprocessingArguments: The 'PreprocessingArguments' value hold any parameters for the command specified in Preprocessing. This value is optional.
  • Postprocessing: The 'Postprocessing' value can specify the command/application to be executed after the MA run profile execution. This value is optional.
  • PostprocessingArguments: The 'PostprocessingArguments' value hold any parameters for the command specified in Postprocessing. This value is optional.
  • ContinueOnFailure: The 'ContinueOnFailure' should be either "true" or "false" (case-sensitive). ContinueOnFailure specifies whether the postprocessing command should be executed based on a non-successful management agent run result. ContinueOnFailure and MA_RUN_RESULT can be used together to do error handling of MA run results.
  • ThresholdLimits: The ThresholdLimits elements lets you specify limits for different pending actions that would result in a profile not being run. For example, you can specify that you only want to import a maximum of 5% deletes (percentage of number of connectors; disconnectors are not included). You may also specify an exact number, i..e. 100 to stop the profile from running if there are more than 100 deletes. You can set threshold limits for import and export add/updates/deletes (see sample abov). This option is valid for version 1.3 and later.
  • WMITimeOutSeconds: Timeout value for WMI connection for this item. Default value is inherited from global setting. This option is valid for version 1.5 and later.

In the Postprocessing command and the PostprocessingArgument, the special string MA_RUN_RESULT is replaced by the actual MA run result return string before being called. If the Preprocessing or the Postprocessing commands return a non-zero error code, then the thread stops.

ClearRunHistory element

Old Run profile histories can be cleared using MARunScheduler. This will be done after all threads have finished.

<ClearRunHistory>
  <ClearRuns>true</ClearRuns>
  <AgeInMinutes>1440</AgeInMinutes>
</ClearRunHistory>

The parameter 'ClearRuns' specifies whether clearing of old run histories is done or not (set to 'true' and 'false' (case-sensitive)) The parameter 'AgeInMinutes' specifies how old (in minutes) a run profile has to be for it to be deleted, i.e. a value of 1440 will delete all run histories that are more than a day old (60 minutes x 24 hours = 1440 minutes).

⚠️ **GitHub.com Fallback** ⚠️