Delete User after it has expired

I want to delete/deactivate users after these have expired.
Question 1 What is the best way to set a new property ‘expiredDate’ that cannot be changed by the users itself.
Question 2: Is there a way to look over all users let’s say once every day and if a user is expired delete this account?

Thank you in advance,

The problem is date functions in Okta expression language, as there are none. But I think you can add a field of type String and put there an expiry date in the predetermined format, like ‘05-05-2021’. Then use a group and a group rule, to determine if today’s date converted into a string in the required format is equal to user’s ‘expiryDate’, to put this user into the group. Then you can easily use Workflow automation to deactivate/delete user based on their membership in a group

1 Like