We have a rare situation where we want to have some users, not all, be delayed in disabling their AD accounts. We like to share their mailbox with their manager for 30 days until we entirely disable the account. Is there an easy way to have it disable accounts for the vast majority of users, but for a very small subset we want to do a shared mailbox for say 30 days and have those accounts not get disabled immediately? We were trying to enable the accounts and share them but it disables them again on the next sync.
Yes this can be setup using conditional expressions:
The enabling and disabling of the user account is controlled by the EnableAccount mapping, so that is the mapping that we will need to modify.
The default expression for this mapping is:
WHEN
Employment.EmployeeStatusCode == ‘A’
THEN
true
enable the account
This means all Active employees should be enabled and everybody else (Terminated employees) should be disabled.
Change this logic by switching it to a condition expression that evaluates the date of the termination:
WHEN
Employment.EmployeeStatusCode == ‘T’ && (DateTime.Now - Employment.DateOfTermination.GetValueOrDefault()).Days > 30
THEN
false
disable the account
*This means all Terminated employees that have been terminated for more than 30 days should be disabled and everybody else (Active and Terminated less than 30 days employees) should be enabled.