Contact us at 408.675.5020 or sales@identitymaestro.com

Home Page

Knowledge Base Search     Advanced

How to: Schedule the WFArchive script to run in the Task Scheduler

Article ID: 1680
Last updated: 09 Apr, 2018

The WFArchive.ps1 script backs up the Workflow Job files that are created during user creation in Identity Maestro. If you are creating large quantities of users, the Workflow centre can become sluggish due to the amount of data being loaded. This can be fixed by scheduling regular backups of the Workflow Job files. The WFArchive knowledge base article contains useful information and details about the script.

WFArchiveScheduler.ps1 provides a convenient way to automatically schedule WFArchive.ps1 into the windows task scheduler. You can customize when the script is run, what it backs up and how often through the arguments listed in the usage section.

Schedule the Task using WFArchiveScheduler.ps1

The WFArchiveScheduler.ps1 utility is available as part of Identity Maestro 4.0.4. The section covers using WFArchiveScheduler.ps1 to schedule automatic archives of the Workflow Job files.

To customize the scheduled task:

  1. Open an elevated PowerShell and navigate to:  \Omni\IdentityMaestro\Utilities.
  2. Then run the WFArchiveScheduler.ps1 script with any combination of parameters from the Usage section.

WFArchiveScheduler Usage and Examples

------------------------ USAGE -------------------------------------------------

WFArchiveScheduler.ps1 [-Interval] [-DayofWeek] [-Time] [-NumberofDays n] [-Quiet]


------------------------ ARGUMENTS ---------------------------------------------

-Interval                This parameter is listed as the number of Weeks that you
                         want between regular runs of the Archive Utility.

-DayofWeek               This is specified as a day of the week: This can be any
                         day of the week from Monday to Sunday written as the full
                         name of the day.

-Time                    This specifies the time of day that the script runs at
                         This is specified as a number between 1-12 and AM or PM.
                         
-NumberofDays            You can specify how far back you wish the script to archive. 
                         This is specified as a whole number such as 60.

-Quiet                   This stops the script from prompting for user input.


------------------------ SAMPLES ----------------------------------------------

WFArchiveScheduler.ps1 | Creates a task with default settings
WFArchiveScheduler.ps1 -Interval 6 | Creates a task that runs every 6 weeks with default settings
WFArchiveScheduler.ps1 -DaysofWeek Tuesday | Creates a task that runs every Tuesday with default settings
WFArchiveScheduler.ps1 -Time 3AM | Creates a task that runs every four weeks at 3AM on the day the script was run.
WFArchiveScheduler.ps1 -NumberofDays 90 | Creates a task with default settings that archives anything older than 90 days.
WFArchiveScheduler.ps1 -Quiet | Creates a task with default settings that does not request user input.


WFArchiveScheduler.ps1 -Interval 8 -DaysofWeek Saturday -Time 2AM -NumberofDays 45 -Quiet | Creates a fully customized task based on the provided settings.

​​

Manually Scheduling WFArchive.ps1

The WFArchive.ps1 utility is available as part of ServiceControl 4.0.3 and can continue to be used with future releases of Identity Maestro.  To manually schedule WFArchive do the following:

  1. Open Windows Task Scheduler.
  2. Click on Task Scheduler Library.
  3. Right-Click on the Central Panel and Select Create Basic Task...


     
  4. Enter a Name and brief description of the Task.


     
  5. Click Next.
  6. On the Task Trigger window select when to run the task, click next. 


     
  7. Select the months to run the task in from the Months dropdown.


     
  8. Select the day of the month to run the script.



    Note:  The time will be set to when the task was created. This can be changed by modifying the time at the top of the form. It is recommended to run the task during quiet hours.
     
  9. On the Select an Action window, select Start a Program.
  10. In Program/script: box enter PowerShell.exe.
  11. In Add arguments (optional): Box, enter the following:
    1. -Command "& 'C:\Program Files (x86)\\Utilities\WFArchive.ps1' -NumberofDays n -quiet"
    2. The -NumberofDays argument sets the point at which the utility begins the backup. For example, if you entered 60 days for n the utility would backup anything older than 60 days from the running date.
    3. The -quiet argument stops the script from producing user prompts.


  12. Click Next > then click Finish
  13. Edit the task by right-clicking selecting properties.
  14. In the general tab, Select Run with Highest Privileges and click OK.

The task will now run with the settings provided creating backups of the Workflow files.

This article was:   Helpful | Not helpful Report an issue


Article ID: 1680
Last updated: 09 Apr, 2018
Revision: 8
Views: 124
Comments: 0
print  Print email  Email to friend share  Share pool  Add to pool comment  Add comment
Also listed in
folder Identity Maestro -> How-to, Tips & Tricks, FAQ -> Workflow Engine: How-to

Prev     Next
How to Backup the Workflow Engine with the WFArchive Script       Outputting File System Permissions using GetFSPermisions.ps1