Skip to content

Instantly share code, notes, and snippets.

@arcanadev
arcanadev / example.cs
Last active January 15, 2024 18:02
Set Job Variables when submitting a job for execution #adTempus #api #version5
//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)
@arcanadev
arcanadev / readme.md
Last active November 13, 2023 21:29
List email notification recipients for Jobs #adtempus #sql #version4

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.

@arcanadev
arcanadev / readme.md
Created March 17, 2023 19:29
Set a new password for a Credential Profile #adTempus #api #version4 #powershell

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

@arcanadev
arcanadev / readme.md
Last active February 15, 2023 18:39
Map a drive letter to a UNC path for a job #adTempus #api #version4

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.

@arcanadev
arcanadev / get-ADTJobHistory.ps1
Last active July 22, 2022 18:39
Query job history and write to a CSV file #adTempus #api #version4 #powershell
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"
@arcanadev
arcanadev / readme.md
Last active April 28, 2022 21:26
Using the adTempus API from Python #adTempus #api #version4

This sample demonstrates how to use the adTempus API from Python.

Background and Requirements

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.

@arcanadev
arcanadev / readme.md
Created November 29, 2021 15:01
Get dates for a Holiday Set #adTempus #api #version4

This script demonstrates how to retrieve a Holiday Set and get a list of the holiday dates that it defines

@arcanadev
arcanadev / readme.md
Last active May 7, 2021 21:15
Delete a job that may be running #adtempus #api #version4

This sample demonstrates how to delete a job through the API.

If you attempt to delete a job that has running instances, you will get an exception. Before deleting a job you should terminate all running instances, as shown below.

@arcanadev
arcanadev / readme.md
Created April 17, 2021 20:20
Submit a job for execution and wait for completion #adtempus #api #version4

This example demonstrates how to submit a job for execution and then wait until execution has completed.

The Execute method returns a collection of all the instances created for the execution request (there may be more than one instance if the job runs in a queue that targets multiple agents). To wait for completion, you must periodically refresh the status of each of these instances until all have finished running.

@arcanadev
arcanadev / readme.md
Last active March 15, 2021 21:30
Grant SQL Server database access to adTempus server #adtempus #sql #version4

This SQL script grants access to the adTempus database for the machine where adTempus is running, allowing adTempus to connect to the database while running under the Local System account.