AzureAD signInActivity inconsistent

tim hodkin 0 Reputation points
2023-03-23T20:21:12.35+00:00

When pulling the information from graphapi using the below path, i get inconsistent results.

https://graph.microsoft.com/beta/users/<user id>?$select=signInActivity

If I run the above over and over I get one of 2 results back that show diferent results. It does not seem to matter what user I select or if i pull the information for all the users at once. If i repeat the search it sometimes gives me a second set of information.

This is the same thing happening with 'get-mguser'. User's image

The same happens on any call to that api.

I'm puzzled as to what may be wrong or if the beta api might just not be ready to pull this information yet.

Cheers

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,565 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,444 questions
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. HarmeetSingh7172 4,811 Reputation points
    2023-03-23T21:18:24.88+00:00

    Hello tim hodkin,

    Thanks for reaching out!

    I'm able to replicate the issue behavior. On running https://graph.microsoft.com/beta/users/<user id>?$select=signInActivity endpoint over and over again, I'm also getting two different set of results. 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.

    I would suggest you use List Sign-ins and Get Sign-in Graph calls. Also note that signIns involve bringing some sensitive information and hence it's restricted for users with higher privileges. A regular user might end up getting an error. Refer this known issue.

    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 comments No comments

  2. tim hodkin 0 Reputation points
    2023-03-24T10:44:27.8033333+00:00

    Hi,

    Thank you for your response.

    Would this be classed as a bug? Is there soms place i can track this?

    I will look into the methods you sugggest for now but being the sign in activity is only 30 days. After that one would need a log workspace to look at the data. The timestamp from the signinactivity is stamped on the user itself and holds until the user is deleted or its updated. This is a much simpler place to retrieve the user last login information and it would be good to be able to use this in the future.

    0 comments No comments

  3. Penna, James (Infrastructure) 0 Reputation points
    2023-03-26T00:44:31.0166667+00:00

    I am using v1.0 Graph and getting similar results, inconsistent data is coming back. very frustrating

    0 comments No comments

  4. tim hodkin 0 Reputation points
    2023-03-26T21:40:37.2533333+00:00

    I have now opened a call to see if there is something that can be done about this inconsistency

    0 comments No comments

  5. tim hodkin 0 Reputation points
    2023-03-27T11:02:17.6666667+00:00

    For those interested. The problem went away, it seems to have been a transient issue.

    Support saw the issue friday but affter the weekend it had disapeared.

    The issue was affecting at least 2 tenats i had access to.

    I am monitoring and reporting back to support.

    And FYI - the Beta and v1.0 graph api were affected oringally.

    For v1.0 use:

    (get-mguser -UserId <user id> -Property signInActivity).AdditionalProperties.signInActivity