ztrhgf / useful_powershell_functions

powershell functions to make my admin work easier
183 stars 52 forks source link

page limits on API calls #6

Open jroth-nexus opened 8 months ago

jroth-nexus commented 8 months ago

On INTUNE/Get-MDMClientData.ps1 the Intune graph API call only returns the first 500 devices. For companies that have large amounts of data, that causes issues.

ztrhgf commented 8 months ago

I guess you are talking about this line? image

Please try to replace Invoke-RestMethod for this one and let me know:

$intuneDevice = Invoke-GraphAPIRequest -header $header -uri "https://graph.microsoft.com/beta/deviceManagement/managedDevices" | select deviceName, deviceEnrollmentType, lastSyncDateTime, aadRegistered, azureADRegistered, deviceRegistrationState, azureADDeviceId, emailAddress