Hi,
I’m having trouble getting a list of applications registered in Azure by querying the MS Graph API. The issue is the paging limitation. I’ve got 157 applications registered in Azure, but the script is only returning the last 57. I know the page limit is 100 by default, so I know WHY it’s doing it, but I can’t seem to get around it. I’ve played around with “@odata.nextlink”, but I can’t seem to get it to work properly, it still only returns the second page of data. Here’s the relevant code:
[pre]
$url = “https://graph.microsoft.com/beta/applications?select=createddatetime,displayname”
do {
$response = Invoke-WebRequest -UseBasicParsing -Headers $headerParams -Uri $url -Method GET -ContentType “application/json”
if ($response.Content)
{
$content = $response.Content | ConvertFrom-Json
$value = $content.value
$count = $value.count
Write-Host $response
Write-Host $value
Write-Host “$iCount || $count”
$nextLink = $content.‘@odata.nextLink’
$url = $nextLink
} else {
$response
}
} while ($nextLink -ne $null)
[/pre]
I know I left out all of the oauth token and header information, but that’s not where the issue is.
Any suggestions would be greatly appreciated.
Thanks