Azure AD user's status

Quyen Nguyen 81 Reputation points

How can i check status ( active or account lock or inactive status) of a user in Azure AD?

Microsoft Entra
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Govind Sharma 11 Reputation points Microsoft Vendor

    There are different ways to check whether a user account is active. One method of detecting inactive accounts is by evaluating the lastSignInDateTime property exposed by the signInActivity resource type of the Microsoft Graph API. There are two ways to do this:

    1. If you search for a specific user by name, you can evaluate the lastSignInDateTime:$filter=startswith(displayName,'markvi')&$select=displayName,signInActivity

    1. You can request a list of users with a lastSignInDateTime before a specified date: le 2019-06-01T00:00:00Z

    Reference: How to manage inactive user accounts

    You can also check if the user is Enabled using Graph API:

    { "accountEnabled": true }
    To check if the user is in a blocked sign-in state, you can use the beta endpoint of the Graph API:{userPrincipalName}

    2 people found this answer helpful.
    0 comments No comments