0 votes

How do we set up an e-mail notification (only once per user) as an scheduled task (ex. every hour) based on the property "accountExpires"?

Some background: Our HR-software automatically synchronises an end date to our AD-users on the value "accountExpires". We want to be able to set up an e-mail that generates a ticket in our ticketing system for offboarding-purposes based on this change in value, but the e-mail should only be created once. If not, the ticketing system will receive and create multiple tickets on the same user every time the schedule runs.

If scheduled tasks is not the best way to achive this result, do you have any suggestions on how to solve it another way?

ago by (120 points)

1 Answer

0 votes
ago by (295k points)

Hello,

Do we understand correctly that the email should be sent on the expiration date? If that is correct, you can use a scheduled task like the following: image.png

0

Hi there,

No, the creation of the e-mail has to be generated if the field changes from an empty value to populated one so that we can follow up internal offboarding-processes before the user quits, ergo before the defined date.

This field on our user accounts in AD are empty up until they deliver their resignations in the HR-software, only then this field is populated with a date.

The date itself is not relevant in this use case, it's only relevant in the sense that it's our deadline for completing every offboarding-steps internally.

+1

Hello,

Thank you for specifying. As the updates are made omitting Adaxes, the only option is to preserve the current expiration dates and then use a comparison in the scheduled task. For the preservation, you can use any of Adaxes custom date attributes (e.g. CustomAttribtueDate1). Finally, you should have something like below. image.png

0

Hi again and thanks for your quick reply,

Will this ensure that we will not receive another e-mail for the same user the next time the scheduled tasks runs?

We only want one e-mail per user if the value is populated.

+1

Hello,

Yes, that is exactly it. Every time the Account Expires property changes, a single email will be sent.

0

Hi again,

We have now tried setting up a solution based on your suggestion, but it doesn't seem to trigger an e-mail. The only thing we can see in the logs is the following:

Operation Initiator Completion Time
Modify USER2, TEST (Domain\Users): clear CustomAttributeDate10 TEST: Schedule Tasks 20.01.2025 13:55:25

The scheduled task is configured like this:

FYI: We have changed the "Property Display Names" of "accountExpires" to "End Date", and we have used the attribute "CustomAttribute10" instead of "CustomAttribute1" due to it being used someplace else in our setup.

Skjermbilde 2025-01-20 140735.png Do you have any other solutions on to how to resolve this issue, or do you think there's anything in our setup that prohibits this to work based on the information provided earlier in the post? We have several "Business Rules" that triggers e-mail notifications (set up just like this one) that still works.

0

Hello,

First of all, you should never set scheduled tasks to run every minute. It is very resource consuming and will never actually work as the next run of a scheduled task is counted from the end of the previous one. In your case running once an hour or even once a day should be just fine.

The setup of your scheduled task is correct. As long as CustomAttribtueDate10 is cleared, the Send email notification action is also executed. How exactly do you check that it is not? Did you check the general log? Are you sure that the email address in the action is valid?

Related questions

0 votes
1 answer

I am trying to find a way to get an hourly report on locked out user accounts to only be sent if the total amout of locked out account exceeds 10 users. Is this possible in ... a way to setup the logic to check to see how many items are returned in a report.

asked Jun 12, 2024 by Vertigo (50 points)
0 votes
1 answer

The script create two reports of inactive workstation operating systems. The report is too detailed to run from one of the adaxes reports. Basically how can I set the script up to ... sure How I did this but I can't find it now (probably something simple).

asked Nov 30, 2022 by mightycabal (1.0k points)
0 votes
1 answer

Hi, Is there a way to run a scheduled task once per user? I am trying to set up a task which will be run daily to alert the user that their account will expire ... want one single email when the expiry falls within 14 days of the alert running. Thanks Danny

asked Jul 16, 2015 by dannyd (200 points)
0 votes
1 answer

Is it possible when sending the email notification to include all recipients in a single email instead of individual emails going out to each user? Thanks

asked Nov 1, 2018 by cory.fiala (50 points)
0 votes
0 answers

Hi, This normally works, and running the email test comes back successful. One user I created though, the step timed out. I am wondering if it's because for this user, one of ... you leave a variable in but not have it time out if the variable doesn't exist?

asked Jul 15, 2016 by AdamFowlerIT (120 points)
3,605 questions
3,292 answers
8,342 comments
548,405 users