Does anyone have a Powershell script that will allow me to disable an adTempus job? I'd like to able to run the script to turn off and on an adTempus job from the command line.
Does anyone have a Powershell script that will allow me to disable an adTempus job? I'd like to able to run the script to turn off and on an adTempus job from the command line.
You can use the attached script file or this code:
param (
[string]$server = ".",
[string]$job,
[switch]$release=$False,
[switch]$hold=$False
)
add-type -path "c:\program files\arcana development\adtempus\4.0\ArcanaDevelopment.adTempus.Client.dll"
$adtempus=[ArcanaDevelopment.adTempus.Client.Scheduler]::Connect($server,[ArcanaDevelopment.adTempus.Shared.LoginAuthenticationType]::Windows,"","")
$context=$adtempus.NewDataContext()
$jobs=$context.GetJobs($job) | ForEach-Object {
if($release){
$_.UpdateHoldType($_.HoldType -band (-bnot [ArcanaDevelopment.adTempus.Shared.HoldType]::DisableTriggers), [ArcanaDevelopment.adTempus.Shared.MissedJobCheckOptions]::NoCheck)
Write-Host "Released ""$($_.FullyQualifiedName)"""
}
elseif($hold){
$_.UpdateHoldType([ArcanaDevelopment.adTempus.Shared.HoldType]::DisableTriggers, [ArcanaDevelopment.adTempus.Shared.MissedJobCheckOptions]::NoCheck)
Write-Host "Held ""$($_.FullyQualifiedName)"""
}
else{
Write-Host """$($_.FullyQualifiedName)"": $($_.HoldType)"
}
}
$context.Dispose()
$adTempus.Dispose()
Use the "-job" parameter to specify the job name to process. This accepts wildcards and group paths. For example,
-job "group 1\*"
will operate on all jobs in "group 1".
Use the optional "-server" parameter to connect to a different server.
Use the "-hold" switch to hold jobs, "-release" to release them. If you don't use either, it will show you the current hold state.
Note that this script only alters the "Disable Triggers" hold option. Other execution types are not affected (e.g., manual execution is still allowed). If you want different behavior, change the script to use the appropriate HoldType values.
Thanks Bill!
How would I reference to instances, in the case where I have different adTempus instances setup on the same server. I'd like to refer to a specific instance.
Replies are disabled for this topic.