Hi Microsoft Team,
We need your guidance on a reliable and Microsoft-supported approach for collecting large volumes of Microsoft Purview Audit Log records through the Microsoft Graph AuditLogQuery API without missing or duplicating any records.
Please consider the following scenario:
- Record Type:
sharePointFileOperation
- Date: November 22, 2026
- Time Range: 01:30 AM to 11:30 PM UTC
- Total Available Audit Records: 600 million
- Maximum records per AuditLogQuery: 1 million
- Maximum query submissions per day: 200
We understand and accept the limit of 1 million records per query and 200 query submissions per day. Our main concern is how to collect all 600 million records across multiple queries and multiple days without missing or duplicating any records.
- Proposed Data Collection Approach (For Validation Only)
We have considered the following approach, but we are not sure whether it is technically possible or officially supported by Microsoft. We would appreciate your confirmation and detailed technical guidance.
Step 1: Create the First AuditLogQuery
Create the first query using the following request body:
{
"filterStartDateTime": "2026-11-22T01:30:00Z",
"filterEndDateTime": "2026-11-22T23:30:00Z",
"recordTypeFilters": [
"sharePointFileOperation"
]
}
Step 2: Fetch the Records
Fetch records from the query until it reaches the 1-million-record limit and completes.
Step 3: Store the Last Successfully Collected Record
If the API returns records in chronological order, identify and store the timestamp of the last successfully collected record (the 1-millionth record).
Step 4: Create the Next Query Using the Last Collected Record's Timestamp
Use the timestamp of the last collected record from the first query as the filterStartDateTime for the second query. Set filterEndDateTime to the original end time.
For example:
{
"filterStartDateTime": "<Timestamp of the last record collected by the first query>",
"filterEndDateTime": "2026-11-22T23:30:00Z",
"recordTypeFilters": [
"sharePointFileOperation"
]
}
Step 5: Continue the Collection Process
Repeat this process, creating subsequent queries using the timestamp of the last successfully collected record, until all 200 available query submissions for the day have been used.
Step 6: Save the Checkpoint
Store the timestamp of the last successfully collected record from the final query.
Step 7: Resume Collection After the Daily Quota Resets
Once the daily query quota becomes available again, create the next query using the saved checkpoint timestamp as filterStartDateTime and the original end time as filterEndDateTime.
Continue collecting the remaining records from where the previous collection stopped.
Step 8: Complete the Collection
Repeat this process across multiple days until all 600 million records have been collected.
- Technical Questions Requiring Clarification
We would appreciate detailed answers to the following questions:
- Does Microsoft Graph return AuditLogQuery records in chronological order (oldest to newest or newest to oldest)? Is this ordering officially guaranteed?
- Can we reliably use the timestamp of the last record returned by one query as the
filterStartDateTime for the next query?
- If multiple audit records have the same timestamp, how can we ensure that no records are missed or duplicated when creating subsequent queries?
- Does the API support filtering using both a timestamp and a unique record identifier so that we can resume collection from the exact last successfully collected record?
- Is there any Microsoft-supported mechanism to retrieve records continuously beyond the 1-million-record limit without creating overlapping queries?
- After the daily limit of 200 query submissions resets, can we safely resume collection from the last successfully collected record using a checkpoint mechanism?
- What is Microsoft's recommended approach for collecting hundreds of millions of audit records completely and without duplicates?
- Time Range Boundary Handling
We also need clarification on how filterStartDateTime and filterEndDateTime boundaries are handled by the API.
- Are the start and end times inclusive or exclusive?
- If the next query starts at the timestamp of the last record returned by the previous query, will the same record be returned again?
- Should we add or subtract a time interval when setting the next query's
filterStartDateTime?
- How should we handle records that have identical timestamps at the boundary between two queries?
- What is the recommended way to ensure there are no gaps or overlaps between consecutive queries?
Please provide a technically accurate explanation of how these boundaries should be handled to guarantee complete record collection without missing or duplicating records.
- Important Requirements
Please do not limit the recommendation to splitting the search into smaller date ranges or applying additional filters.
Our requirement is to continuously collect all available records across multiple queries and multiple days, using a reliable checkpoint mechanism to resume from the last successfully collected record.
The solution must ensure:
- All available audit records are collected.
- No records are missed.
- No duplicate records are introduced.
- Collection can safely resume after the daily query quota resets.
- The process can handle large volumes of records across multiple days.
- Expected Technical Explanation and Scope
Please explain the complete data collection process specifically using the Microsoft Graph AuditLogQuery API.
We need detailed guidance on:
- How to create AuditLogQuery requests.
- How to fetch all available records from each query.
- How to determine when a query has reached its record limit and completed.
- How to identify the last successfully collected record.
- How to use that record as a checkpoint for the next query.
- How to continue collection across multiple queries and multiple days.
- How to handle timestamps, unique record identifiers, and query time boundaries to prevent missing or duplicate records.
Please do not provide PowerShell commands, PowerShell scripts, or PowerShell-based solutions. We are not looking for instructions on how to execute the collection through PowerShell. We only need a detailed explanation of how to achieve this using the Microsoft Graph AuditLogQuery API, including the relevant API requests, response handling, filtering capabilities, and supported collection mechanism.
- Expected Guidance from Microsoft
The sequential collection approach described above is only our assumption. We are not claiming that Microsoft Graph officially supports this mechanism.
We request that you clarify:
- Whether this proposed approach is technically possible and officially supported by Microsoft.
- If supported, please provide the detailed implementation steps, relevant API capabilities, filtering rules, ordering guarantees, and checkpoint mechanism required to implement it reliably.
- If it is not supported, please explain the exact API limitations that prevent this approach.
- Please recommend an alternative Microsoft-supported API-based solution or architecture that can reliably collect all 600 million audit records without missing or duplicating records.
Since this is a high-volume audit data collection requirement, we would appreciate a detailed technical response rather than a general recommendation to split the search into smaller time ranges.
If necessary, please escalate this request to the Microsoft Graph or Purview Audit engineering team for further technical clarification.
Thank you for your support.
Best regards,
Satheesh M