Hello! I have the following problem: FOR EXAMPLE, when I create an alert with a toolbox, which contains a shutdown /r /f to be executed on Fridays at 8:00 p.m., if a computer IS NOT CONNECTED, when it is turned on the script will be executed. It is as if the script is left in a queue. The same thing happens if I create a toolbox to display a message. Is that so? Thank you!
Can you send screenshots of how your alert is configured?
I dont believe actions queue.
I also dont think you can set a time for an action. So is your toolbox evaluating the date and time? What determines the time and date?
Hola!!! si, te adjunto una captura como ejemplo.
Although this alert is configured to run tonight at 8:30 p.m., if a computer is turned off at that time, and it is turned on tomorrow at 7 a.m., this alert will be run.
ok. I see now.
I didn’t know it would work like that. Good to know.
The problem is you are using the restart script as a trigger.
Your script should actually be set as an action, not a trigger. The trigger tells if it should run or not. The schedule tells it when to start checking if it should run. And you have it rechecking every 5mins from when it was scheduled to start.
To solve this create another toolbox script.
In the powershell script use this:
#Check what number day of week is for friday
$friday= [Int] [DayOfWeek] "Friday"
# returns 0 through 6 for current day of week for current day
$dayofweek =[Int] (Get-Date).DayOfWeek
#if day of week = friday run code.
if ($dayofweek -eq $friday )
{
#code
Write-Output "Its Finally Friday! Continue to run action."
}
# else throw an error so no action is taken
throw $_
Set your schedule start day and repeat once every day.
Set Trigger tool to run if returns zero.
Then put your restart script as the action.
It should look something like this:
That should fix your issue.
Make sure to test.
Hello! Thank you very much for your answer!
I understand that it is used as a trigger, but it would be fine if it functioned as a single-execution scheduled task.
In your example, you would have an alert activated just because it was Friday.
In one of all the tests I carried out, I had used ServerUtilsWaitUntilOnline(@ThisMachine), to verify if the equipment was connected, but it didn’t work either.
I appreciate your message!