When querying the Microsoft Graph API, results are capped at 1000 items per request, requiring pagination handling. Using PowerShell's Invoke-RestMethod cmdlet, you can retrieve all results by following the @odata.nextLink URL returned with each response. The post walks through obtaining an auth token, building the initial query URL, and looping through pages using either a while loop or a do-until loop to collect all items into a single array.

4m read timeFrom playfulprogramming.com
Post cover image
Table of contents
Prerequisites Copy link Link copied!Step 1: Define the initial query URL Copy link Link copied!Step 2: Invoke the query and store the results Copy link Link copied!Step 3: Loop through the pages and append the results Copy link Link copied!Conclusion Copy link Link copied!

Sort: