0 votes

Hello, I would like to be able to limit the number of emails sent by a scheduled task in a specified time period. For example the scheduled task for password change reminder would never have more than 50 people, so I would like to have something that says if the task sends more than 50 emails within any 5 minute period stop/freeze the action and request approval to continue, or if approval is not possible stop the action and send an email to the system admin. I would assume this could be done with powershell and a counter. The reason I am asking for this, we had a scheduled task that had a coding error, an OR statement instead of an AND statement, and almost 2,000 people received a confusing email :oops: . I would like to have something that I can put on scheduled tasks to prevent this in the future.

by (470 points)

1 Answer

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

Hello,

Currently this can't be done unless you send emails to all the users with the help of PowerShell. However, in this case you will have to put all the logic of the Scheduled Task in the PowerShell script, and also there can't be a global solution for all the Scheduled Tasks. You'll have to deal with each task one-by-one. This seems completely counter-productive.

Instead, we would suggest making some sort of a test run to make sure that a Scheduled Task works correctly. For example, if you are not sure about the conditions in your Scheduled Task, on the 1st run, instead of sending emails, you can modify a certain property of the AD objects that you don't use. It is a simple action that will not raise unnecessary attention and that you can easily undo. When completely satisfied with the test results, you can replace the action that modifies the property with the Send e-mail notification action.

Related questions

0 votes
1 answer

password reset emails - i need my company logo in the email - it does show up if you click on download pictures - but i cant ask the users to do this - so need to know if there is a way to embed the image in the email from adaxes.

asked Jul 28, 2021 by Nick Davis (20 points)
+4 votes
1 answer

We set up a new hire form that has serveral custom text attributes that include pay rate, etc. These fields are routed to the correct departments via a PowerShell ... Is there anyway to prevent certain attributes from displaying in the approver request email?

asked Jan 8, 2020 by dhuffman (80 points)
0 votes
1 answer

Hello everyone, I've received a task to send a report of pending and denied approval requests of a specific task to an email of one of our managers. Since ... $report = $reportHeader + $reportFooter # Send Mail $Context.SendMail($to, $subject, $NULL, $report)

asked Apr 7, 2020 by rshergh (110 points)
0 votes
1 answer

Wether sent via email or sms are these passwords sent in plain text? is there options on if these passwords are sent in plaintext or not?

asked Jan 25, 2022 by Keonip (160 points)
0 votes
1 answer

Hi we have bunch of custom commands that HR uses, to create new user employee or offboard someone. They can see the execution log on the web interface, but we would like to recive a copy of the log in an email to IT to make sure there arent errors etc.

asked Jun 30, 2021 by TJ_Umredkar (140 points)
3,346 questions
3,047 answers
7,777 comments
544,977 users