Is there an API in Microsoft Azure where I can identify if a user is inactive or logged out of Tenant

Tiwari, Vaibhav 1 Reputation point


I could find a MS graph sign API which gives me last signin datetime but could not find API which can give me last signout time or how long a user is inactive.

Sign in API -

PLease can someone suggest how can I identify if a user is inactive or logged out of MS azure tenant


Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,448 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,736 Reputation points Microsoft Employee

    Microsoft Entra does not provide a direct API to determine if a user is inactive or has logged out of the tenant. The reason for this is the nature of token-based authentication used by Entra. When a user signs out, it does not necessarily invalidate their token - the token will continue to be valid until it expires.

    The SignIn logs from Microsoft Graph API can be used to find when a user last signed in, but it doesn't track when a user signs out or if a user is inactive.

    Some suggestions to try can be using User Presence Information If you're using Teams -{id}/presence or using Entra audit logs to check for recent activities -

    That said, I would suggest a review of the action that requires you to check if a user is active. Often times if a user should not be active, an admin can invalidate all logins. See

    0 comments No comments