How to set accountExpires attribute to current date\time on user suspend
Summary: This article has step-by-step instructions on how to set the accountExpires attribute to current date\time on user suspend.
Applies to: Cayosoft Administrator 8.x or later.
Configuration
If you set the user account expiration date and then check the accountExpires attribute in Active Directory Users and Computers (ADUC) you will see that ADUC shows the end of that date.
For example, if you set 2-November- 2021, in the accountExpires you will see 11/03/2021 12:00:00 AM. This is the same as 11/02/2021 24:00:00. That is how the accountExpires works in Active Directory.
In the Cayosoft Administrator Console, create the AD Users | Set Attribute Value rule: .
In the Limit scope set User created in Web UI.
In the Query criteria set ObjectGUID of User Created in Web UI.
In the Attributes select accountExpires.
-
In the Value copy/paste this script:
Copy([DateTime]::Now.Date.AddDays(1).ToFileTime()) Save changes.
Configure this rule to run after Suspend User web action.
After that, when the Suspend User web action is performed, the user the accountExpires attribute will be updated.
Comments
0 comments
Please sign in to leave a comment.