0 votes

I have a scheduled task that needs to run every 2 hours, but it must not run outside of office hours. Is there any way to achieve this?

by (170 points)

1 Answer

0 votes
by (270k points)
selected by
Best answer

Hello,

Unfortunately, there is no possibility to configure the schedule of a task in such a way. Howevr, thank you for the suggestion, we forwarded It to the corresponding department for consideration.

As of now, you can achieve the desired using the below script in a condition of your task. The script returns true only if the current hour does not match any of those specified in the $excludeHours variable.

$excludeHours = @(3, 10, 15) # TODO: modify me

# Get current date
$currentDate = [System.DateTime]::UtcNow

foreach ($excludeHour in $excludeHours)
{
    if ($excludeHour -eq $currentDate.Hour)
    {
        $Context.ConditionIsMet = $False
        return
    }
}

$Context.ConditionIsMet = $True

Related questions

0 votes
1 answer

I would like to add "Configuration > Scheduled Tasks" to the Adaxes Web UI. I canĀ“t find an option to impelement this. Any hints?

asked Feb 9, 2021 by MatthiasP (40 points)
0 votes
1 answer

Is it possible to run a report to get users disabled in the last 24 hours?

asked Jun 10, 2020 by peggleg (110 points)
0 votes
1 answer

We're running version 3.9.15526.0 of Adaxes, and in the Web Interface when you try to edit the logon hours for the user, you can not select hours 9 and 10 individually. In ... top, and that does work. I confirmed that it doesn't work in either Chrome or IE.

asked Nov 28, 2018 by rurbaniak (1.4k points)
0 votes
1 answer

At user creation, when the inbox is created, I'd like to be able to format the address as firstname.lastname@domain.com for some users. Other users firstnameintial.lastname@domain.com, is this possible? Envornment is hybrid O365. Thanks!

asked Jan 4 by cewilson (120 points)
0 votes
1 answer

Hello, We recently applied the 2023 upgrade following the backup / uninstall / install / restore procedure and we faced an issue: UUIDs for Business Units changed, which ... upgrade Adaxes in the future that does not delete and recreate Business Units? Cheers

asked May 4, 2023 by ygini (240 points)
3,326 questions
3,026 answers
7,727 comments
544,678 users