Hello,
You will need to configure the Scheduled Task to run for user accounts on a daily basis and add the If PowerShell script returns true condition to it. The condition will be met only if the date specified in the Decommissioned Date property of a user account is yesterday. In this case, the task will not run for users that do not match the condition. To check the date, you can use the below script. In the script, the $property variable specifies the LDAP name of the Decommissioned Date property.
$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.Date -eq ($currentDate.Date).AddDays(-1)