'Get a user's last login timestamp with Microsoft Graph

Is it possible with Microsoft Graph to get the timestamp for last login for a specific user?

Looking in the Microsoft Graph docs I can see that you can use GET https://graph.microsoft.com/v1.0/auditLogs/signIns to get the sign-in details (presumably for all users), however this appears to be a time-consuming query (and that's if it doesn't timeout).

Is it possible to do something like GET https://graph.microsoft.com/v1.0/auditLogs/signIns/{user-ID}?

If anyone knows a work-around to get the equivalent information relatively quickly that'd be really helpful.

Thanks!



Solution 1:[1]

The user last Sign activity can be checked from this API.

https://graph.microsoft.com/beta/users?$select=displayName,signInActivity

If you want to check in beta version of graph explorer you can refer this signInActivity.

If you are looking last signin to a specific apps, then you can try MS Graph List signIns with filters like.

/auditLogs/signIns?$filter=userId eq 'userId' AND appDisplayName eq 'Display Name'

Please refer this DOC for more info.

Hope this helps.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mehtab Siddique