This script uses the adTempus API to get an ExecutionHistoryItem representing the job instance in which the script is running. You can use this to get detailed information about the instance and its steps. In this example the script logs messages giving the status for each step that has executed so far.
This PowerShell script uses the adTempus API to retrieve a File Server definition and set a new password for it.
Usage:
.\set-ADTFileServerPassword -fileServer serverName -newpassword password
This script can be run by an adTempus script task to set a Job Variable to the last business day of the month prior to when the script is run.
It sets the job variable "LastBusinessDayOfPriorMonth" to this date in yyyy-MM-dd format.
The script excludes Saturdays, Sundays, and holidays when looking for the last business day.
There are three versions:
- Sample 1 uses the holiday set configured for the calling job. It does this by looking at the enabled schedule triggers for the calling job and taking the first holiday set it finds.
- Sample 2 always uses a specified holiday set. In the example it's "Standard U.S. Holidays"; change the name if you use a different set.
- Sample 3 ignores holidays. This version will work for you if you never have a holiday in the last 3 days of the month.
This script can be used if you want to trigger a job using a file and set Job Variables from values in the file.
To use the script, create a new Shared Script in adTempus using C# as the language and this script as the script body. In your job, configure the File Trigger as normal and add a Script Execution Task as the first step of the job to run the Shared Script.
The script gets the name of the trigger file, reads it, and sets the variables.
//Connect to the local adTempus server, using Windows authentication. | |
using (var connection = Scheduler.Connect()) | |
{ | |
//Create a DataContext to work in. All object operations take place within this context. | |
//Use a Using block so the context is disposed when we finish with it | |
using (var context = connection.NewDataContext()) | |
{ | |
//Fetch the job named "My Test Job" | |
var job = context.GetJob("My Test Job"); | |
if (null == job) |
This SQL script lists the names and addresses of all Notification Recipients used by Notification Actions in Responses defined for Jobs and Job Steps and for Notification Tasks within jobs.
This PowerShell script uses the adTempus API to retrieve a Credential Profile and set a new password for it.
Usage:
.\set-adtcredentialpassword -account userid -newpassword password
This fragment demonstrates how to add a mapped network drive to a job
This code creates a NetworkConnection resource to map a drive letter to a UNC path for use within the job.
param ( | |
[string]$server = ".", | |
[string]$job = "*", | |
[datetime]$start=, | |
[datetime]$end, | |
[Parameter(Mandatory)] | |
[string]$output | |
) | |
add-type -path "c:\program files\arcana development\adtempus\4.0\ArcanaDevelopment.adTempus.Client.dll" |
This sample demonstrates how to use the adTempus API from Python.
The adTempus API is only available as a .NET assembly, but can be referenced from Python by using Python.NET.
Refer to the Python.NET documentation for installation instructions. Once Python.NET is installed, your Python code can reference the adTempus client assembly as shown below.