A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
Good day Shafiq,
Unfortunately, this behavior is expected when collecting last login data for a large number of users. Querying each user individually through PowerShell or Microsoft Graph generates a high volume of API requests, which can slow down the process and trigger throttling.
To improve performance, you may consider the following:
Ensure that your operating system and Exchange Online PowerShell module are fully updated while avoiding legacy Remote PowerShell connections.
Option 1: Use Microsoft Entra signInActivity
Retrieve users together with the signInActivity property.
Use LastSuccessfulSignInDateTime to identify the latest successful account access.
Avoid running separate mailbox queries for each user.
Option 2: Reduce the number of Graph requests
Request only the properties you need.
Process users using paging or batch retrieval.
Avoid multiple API calls per user whenever possible.
Option 3: Check for throttling
Review your script for HTTP 429 responses.
Honor the Retry-After value returned by Microsoft Graph.
Implement retry and backoff logic instead of sending immediate repeat requests.
Additional information is available in the following resources:
signInActivity resource type - Microsoft Graph v1.0 | Microsoft Learn
Microsoft Graph throttling guidance - Microsoft Graph | Microsoft Learn
About the Exchange Online PowerShell V3 module | Microsoft Learn
I hope this information is helpful. If you have any questions or need further support, please don’t hesitate to reach out at any time.
Thank you for your patience and understanding.
If the answer is helpful, please click "Yes" and kindly upvote it. If you have any extra questions about this answer, please click "Comment".
Note: Please follow the steps in the forum documentation to enable e-mail notifications if you want to receive the related email notification for this thread.