Microsoft Graph API: List Inactive Users

Lukeperez 21 Reputation points
2022-09-07T23:54:49.697+00:00

We need Microsoft Graph API to list down all the inactive users in our tenant. Appreciate your response. Thanks.

Microsoft Graph Users API
Microsoft Graph Users API
A Microsoft API that allows you to build compelling app experiences based on users, their relationships with other users and groups, and the resources they access for example their mails, calendars, files, administrative roles, group memberships.
647 questions
No comments
{count} votes

Accepted answer
  1. HarmeetSingh-MSFT 4,026 Reputation points Microsoft Vendor
    2022-09-08T00:14:55.607+00:00

    Hi @Lukeperez

    Hope you're doing well.

    If you are searching for a specific user by name, which enables you to evaluate the lastSignInDateTime, you can use-

    https://graph.microsoft.com/beta/users?$filter=startswith(displayName,'markvi')&$select=displayName,signInActivity

    If you are looking for list of users with a lastSignInDateTime before a specified date, you can use-

    https://graph.microsoft.com/beta/users?filter=signInActivity/lastSignInDateTime le 2019-06-01T00:00:00Z

    Documentation reference- https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/howto-manage-inactive-user-accounts#how-to-detect-inactive-user-accounts

    Please note that APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

0 additional answers

Sort by: Most helpful