Microsoft Intune Spoke - device with most recent last check-in date/time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago - last edited an hour ago
Hello,
I'm working with an internal team for an evaluation of the Microsoft Intune Spoke.
The requirement given to me is to get the Azure AD Device ID from the device with the most recent Last check-in date. I'm not an Intune expert (far, far from it), but there can be multiple entries for the same device in Intune, each with a different "Last check-in" date.
To accomplish this, we've copied the "Look up Managed Devices" data stream action and modified it to include an additional output for the Last check-in date (this field is "lastSyncDateTime" in the response body from the Microsoft Graph API).
We then had to do some date/time conversion to get this date/time value in a format that could be consumed by a Flow.
Finally, in the calling flow, we call our modified "Look up Managed Devices" action and loop through the results, ultimately setting a flow variable to the device with the most recent Last check-in date ("lastSyncDateTime")
Alternatively, we could have modified the action to perhaps do the filtering and sorting in the API call that retrieves the data, potentially even down to one result, reducing the need to loop through results in the flow.
Perhaps something like this:
/v1.0/deviceManagement/managedDevices?$filter=contains(deviceName,'XXXXXXX')&$orderby=lastSyncDateTime desc
Although, we didn't pursue this approach because it was relayed to me that the results from this are inconsistent and we would be better suited to pull all results for a particular device and loop through them as mentioned.
Looking to see if anyone has run into a similar requirement, and if so, how did you tackle the it?
Thanks in advance.
- Labels:
-
Flow Designer
