I’m trying to get sign-in logs for guest accounts, but the portal query keeps taking a long time and then fails with a throttling error. Is there a better way to retrieve or filter these events?
What’s the least painful way to pull guest sign-in logs?
Answers
For a one-off export, try Microsoft Graph PowerShell rather than repeatedly running the portal search. Connect with the audit-log read permission, query sign-in records with a guest-related filter if the service accepts it, and export the results. Check the returned records to confirm the filter is doing what you expect, since filter support and syntax can matter.
Reply to this answer
Keep the request small. A broad sign-in query can be slow, so narrow it by date range and, where supported, user type or another useful field. If throttling still happens, wait and retry with backoff instead of firing off several requests in quick succession.
Reply to this answer
If this is a recurring report, sending sign-in events to a Log Analytics workspace can make later searches and dashboards easier. That adds ingestion and retention costs, though, so it may be overkill for an occasional export.
Reply to this answer
Be cautious with a security hunting query that starts from an assumed guest field. The result can be misleading if the field is unavailable, named differently, or populated differently in that data source. First inspect a few records and verify how guest accounts are represented, then build the filter around the fields actually present.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions