0 votes

Hi,

We've got a business rule setup that when an account is expired it mails certain people to take certain actions. This works fine, however we've had an issue lately, where a temp became permanent, therefore the account expiry was removed. This triggered an email, stating that the account expires never

Whilst I appreciate this is a valid response is there a way that when the date is removed it sends a different email? I can't wrap my head around the logic using Adaxes conditions :(

As a work around, I amended the rule so that it only sends the email if the employee type has not changed, from temp to permanent for example. Not ideal but it sort of works.

Essentially there's three types of notifications I need regarding Account Expiry:

1) Account is set to expire that was empty before - sends an 1 email to say an expiry has been set what we have in place works for this one - but maybe you guys can think of a better solution
2) A user moves from Temp to permanent, so the account expiry is removed - I'd like a different trigger for this to send an email.
3) An account expiry is amended - sends a similar email as per point 1, but lists the old expiry and new expiry date.

Thanks in advance

by (490 points)

1 Answer

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

Hello,

Yes, you can use the If account/password <expiration status> condition for this purpose.

For example, your Business Rule can look something like this:

0

That was.....stupidly simple and I should have seen it, thank you very much!

When the account expiration changes from one day to the other, is there a way to capture the old details and new into an email notification?

Presumably I'd need to copy the old value to a custom attribute and include it in the email?

0

Hello,

Yes, you will need to create a Business Rule that will write the current value of the Account Expires property into a custom text attribute (e.g. CustomAttributeText1) using the following PowerShell script:

$propertyName = "adm-CustomAttributeText1" # TODO: modify me

$accountExpires = $Context.TargetObject.Get("accountExpires")
if ($accountExpires -eq 0 -or $accountExpires -eq 9223372036854775807)
{
    $Context.TargetObject.Put($propertyName, "Never")
}
else
{
    $date = [DateTime]::FromFiletimeUtc([Int64]::Parse($accountExpires))
    $Context.TargetObject.Put($propertyName, $date.ToString())
}

$Context.TargetObject.SetInfo()

The Business Rule will look like the following:

To include the old value of the Account Expires property into the email notification, use the %adm-CustomAttributeText1% value reference in the Message text.

Related questions

0 votes
1 answer

Hello, I'm trying to create a business rule that will update a user account expiry date when that user logs in for the first time. I'm new to Adaxes, so I don't have a ... updated by a user's action, such as "Last Logon". Is it possible to make this work?

asked Mar 6 by sjjb2024 (60 points)
0 votes
1 answer

Hi support, [https://www.adaxes.com/questions/752/import-data-wizard] I am trying to do something similiar to this however in our csv file the column is called ... powershell task as you have highlighted to add the ldap value to the accountExpires attribute?

asked Feb 19 by MikeBeattie (110 points)
0 votes
1 answer

Hi, I'm trying to see if there's a way where from the web interface, I can have a simple single display to set an account expiry in the future. I don't ... to restrict other fields from being visible from other options, like Modify User. Is this possible?

asked Feb 24, 2016 by AdamFowlerIT (120 points)
0 votes
1 answer

When setting user accounts to disable we use a business rule which executes whenever a user account is modified. So for example a member from our Service Desk team will go onto ... behind for some reason, and doesn't reflect the server date/time it lives on.

asked Nov 16, 2022 by Homelander90 (350 points)
0 votes
1 answer

Hello, My question potentially piggy-backs off of the following URL: Automated Expiry of Group Membership We have the need to add/remove users frequently to/from a ... something like this in Adaxes? Thanks in advance for any replies or assistance. Jason

asked Jan 29, 2019 by slowllama (100 points)
3,588 questions
3,277 answers
8,303 comments
548,097 users