0 votes

Hello, I need to create a notification for a birthday style reminder every year on the month and day of a collaborator's birthday or work anniversary in the company.

example today we have a date and time fields that we perform some automation, sending onboarding and offboarding, this works, because the schedule validates if the date and time of the field is true.

However, we need to take that same onbording date field, and every year following that date, on the same day of the month, it will perform an action.

Would you be able to perform this action?

by (40 points)

1 Answer

0 votes
by (277k points)

Hello,

Do we understand correctly that the required date is stored in one of user account properties and every year you need to send an email when the current date matches the one in the property despite the year? If that is correct, you can use a scheduled task with the below script condition. In the script, the $property variable specifies the name of the property storing the date to check. The task should be executed on a daily basis. Finally, it will look like the following: image.png

$property = "adm-CustomAttributeDate1" # TODO: modify me

# Get attribute value
try
{
    $compareDate = $Context.TargetObject.Get($property)    
}
catch
{
    $Context.ConditionIsMet = $False
    return
}

# Compare dates
$currentDate = [System.DateTime]::UtcNow
$Context.ConditionIsMet = ($compareDate.Month -eq $currentDate.Month) -and ($compareDate.Day -eq $currentDate.Day)

Related questions

0 votes
1 answer

Is it possible to schedule quarterly or yearly (eg. twice a year) for reports in version 2018.1 ? Seems that monthly is as far as it can be streched?

asked Jul 11, 2018 by pafa (500 points)
0 votes
1 answer

Hi, I have a need to run a report on users who haven't logged on in over 90 days. I found your Inactive Users report in the Web Interface, which does exactly what I need, ... tasks on them (disable and move to another OU). Is there a way to do this? Thanks!

asked Feb 24, 2016 by bthompson (50 points)
0 votes
1 answer

For monthly scheduled tasks, I would like to see "day" changed to a drop down list like so: On the [number] [day] of each month at [time] Some examples: On the [15th] [day] of ... ] [day] of [month] Examples: On [April] [1] On the [1st] [Monday] of [April]

asked Apr 1, 2013 by Kikaida (1.1k points)
3,411 questions
3,108 answers
7,912 comments
545,849 users