MARunScheduler

MARunSchedulerThis is the online manual for MARunScheduler. If you are currently using MARunScheduler, you can refer to this page as your reference. Also, this manual will be updated along with the product. Any tips, tricks or suggestions for improving the MARunScheduler are very welcome - so please feel free to comment.

What is the MARunScheduler?

MARunScheduler is a plug-in replacement for Microsoft's MASequencer which is used to automate the order in which management agents are run. MARunScheduler uses input from an XML file, which contains information about the management agents to be sequenced. The MASequencer from the MIIS 2003 Resource Tool Kit is not compatible with FIM 2010 (64 bit), so you need alternative methods for scheduling run profiles for FIM. I believe in simple solutions and though you of course can write VBScripts or PowerShell scripts to schedule your runs, I like the idea of the old MASequencer. That is why I decided to write a similar tool for FIM2010. MARunScheduler can be run from the local system where the FIM2010 or FIM2010 R2 service is installed through the command-line -

marunscheduler /f:<filename>

The 'filename' specifies the path of the XML input file which contains the details of the management agents to be sequenced. You can obtain more information on TechNet about how you define and configure Run Profiles.

The XML configuration file

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">
  ...
</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.

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">
  ...
</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.

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">
  <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.

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).

Download

There are two ways to obtain the software -

Pay for the newest version
You can buy the MARunScheduler here. Buying the product helps encourage further development and entitles you to three (3) months of support via mail (a maximum of 5 incidents).






Don't pay for it
You could choose not to pay for it and just download it for (download version 1.3.2.1).

Disclaimer and support options

This is a donation-ware product and therefore no official support is provided. However, if you or your company requires available support, there are support options available. Please contact me at soren@granfeldt.dk for other support options.

Version History

  1. Version 1.3.2.1 | February 25, 2013 - Added support for RunOnlyIfPendingImports and threshold options as suggested by Jorge (see comments below)
  2. Version 1.2.0 | September 23, 2012 - Added options for threads and items to specify weekdays to run. Fixed bug on clear run history where time stamps were not honored probably.
  3. Version 1.1.0 | September 5, 2012 - Added option to disable logging for entire configuration. Added attribute option 'LoopIndefintely' for threads. Added options for time restriction both for threads and for items using the keywords 'RunAfter' and 'RunBefore'. Added additional logging information to accommodate new settings. Additional error handling was added for specific situations (download no longer available).
  4. Version 1.0.1 | August 27, 2012 - A few bugs fixed and added support for clearing run history. Introduced the Item setting 'OnlyRunIfPendingExports' to control run profile only to run if there were pending exports.
  5. Version 0.90 (beta) | December 6, 2011 - Initial version released for beta testing

7 comments:

Jorge de Almeida Pinto said...

Hello Soren,

I would like to propose the following features for the MA run scheduler:
[1] Ability to specify which days of the week the item/thread should run (e.g. deltas during the week, fulls during the weekend)
[2] ability to monitor for import updates/creates/deletes (e.g. if the number of imported deletes exceeds the defined % threshold or the numeric threshold for imported deletes, the full/delta sync will not be executed and some warning is send out (event viewer and/or mail))
[3] ability to monitor for export updates/creates/deletes (e.g. if the number of pending export deletes exceeds the defined % threshold or the numeric threshold for pending export deletes, the export will not be executed and some warning is send out (event viewer and/or mail))

[2] and [3] prevent damage of data within the IDM system and target connected systems if something goes wrong in source connected system(s)

Best Regards,
Jorge de Almeida Pinto
http://jorgequestforknowledge.wordpress.com/

Søren Granfeldt said...

Hi, Jorge...

Great ideas. I'll definitely try to include some of these for next version. Like the idea of thresholds.

Søren Granfeldt said...

Hi, Jorge...

You triggered me. I just released a small update with the weekday suggestion implemented. Let me know what you think.

Jay Van Zant said...

Hello, it looks like the MA doesn't support concurrent/nested runs. Is this so?

Søren Granfeldt said...

It should support concurrent runs/threads. Don't know what you mean by nested runs.

Jay Van Zant said...

Thanks Søren. I'm evaluating a few scheduler tools and some of them allow for mixing simultaneous and sequential run profiles, i.e:

AD-DIDS, then FIM-E/DIDS, then in parallel run exports/DIDS' to various other systems if there are pending exports.

I don't know how I would do that with MARunScheduler.

Søren Granfeldt said...

Okay, I see. No then current version does not support nested runs as you are trying to do; only parallel, independent threads.