Forum Discussion
pema012
Oct 04, 2021Copper Contributor
Azure AD account expiration date
We are in need of having expiration date for Azure AD User accounts. How do we acomplish that?
- Oct 06, 2021In the end I solved my issue by creating a list in Sharepoint online containing user accounts object ID and the last day of employment as a date.
Then in Microsoft Power Automate I created a flow running every night checking if any records in the list are the same or earlier than today and if so setting AzureAD account to be disabled in Azure AD. When on it I also remove the account from the Azure AD security group providing Microsoft 365 licenses.
So by not having account expire date in Azure AD in the end was giving me the opportunity to do more. Thanks Microsoft. 😄
kdrumm5000
Dec 07, 2022Copper Contributor
Not trying to revive a dead thread here, but anyone looking for this should see a new attribute on their user accounts called "employeeLeaveDateTime." I believe that this attribute did not exist prior to the introduction of Lifecycle Workflows, which is in public preview but requires an Azure AD P2 license. If you have P2 licensing, you can utilize Lifecycle Workflows to accomplish account expiration. But for anyone else you should be able to interact with employeeLeaveDateTime using the Graph API. This would allow you, for instance, to set an expiration date by running a Logic App on a recurring schedule and when the date hits you can disable the account.