How to get azure ad user lastlgindate ?

SK 1 Reputation point
2021-01-28T10:52:27.843+00:00

Not getting lastlogindate using 'https://graph.microsoft.com/beta/users?$select=id,createddateTime,signInActivity' only id & created time I am getting

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,800 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,316 Reputation points
    2021-01-28T11:52:45.657+00:00

    Hi @SK · Welcome to Q&A platform and thanks for your query.

    I just tested running above call in my tenant and got the lastSignInDateTime in response as you can see below:

    61376-image.png

    Could you please confirm you have consented for below permissions and if you decode your access token at https://jwt.ms below permissions are present in SCP claim:

    • AuditLogs.Read.All
    • Organisation.Read.All

    Also, the lastSignInDateTime property is a new feature, the value of the lastSignInDateTime property can be blank if:

    • The last successful sign-in of a user took place before April 2020.
    • The affected user account was never used for a successful sign-in.

    Read more:

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments