I'm trying to figure out how to call the odata.nextlink from a powershell script im writing to get Azure AD signin information for users.
$LastLogin = Invoke-WebRequest -Headers $AuthHeader1 -Uri "https://graph.microsoft.com/beta/users?`$select=displayName,userPrincipalName,signInActivity" -Verbose
$result = ($LastLogin.Content | ConvertFrom-Json).Value
$result | select DisplayName,UserPrincipalName,@{n="LastLoginDate";e={$_.signInActivity.lastSignInDateTime}}
and it results in the first 100 results being disaplayed
if I view the $lastLogin output I can see the content includes the odata.nextlink option but I can't seem to get the uri to pass into a while loop to get all the results
if I do $lastLogin."@odata.nextLink' it just returns a null value.
Where am I going wrong?
Thanks
