Report on a device's recent check-ins

%3CLINGO-SUB%20id%3D%22lingo-sub-2231001%22%20slang%3D%22en-US%22%3EReport%20on%20a%20device's%20recent%20check-ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2231001%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20the%20need%20to%20run%20a%20report%20for%20all%20of%20our%20corporate%20devices%20in%20Intune%20to%20show%20the%20most%20recent%20checked-in%20user.%26nbsp%3B%20Right%20now%2C%20the%20only%20place%20I%20see%20the%20info%20is%20if%20we%20use%20the%20Intune%20for%20Education%20portal.%26nbsp%3B%20When%20you%20go%20to%20the%26nbsp%3B%20record%2C%26nbsp%3B%20under%20details%20you%20see%3A%26nbsp%3B%26nbsp%3BProperties%2C%26nbsp%3BDevice%20Actions%2C%26nbsp%3B%3CSPAN%3ERecent%20check-ins%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20haven't%20been%20able%20to%20find%20anywhere%20to%20report%20on%20that%20field%20-%20have%20tried%20graph%20explorer%20and%20PowerShell.%26nbsp%3B%20The%20data%20must%20exist%20somewhere%2C%20any%20help%20you%20can%20provide%20would%20be%20appreciated.%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EPS%20-%20this%20is%20similar%20to%20a%20thread%20from%202019%2C%20but%20no%20solution%20was%20found%2C%20thought%20I%20would%20bring%20it%20back%20up.%26nbsp%3B%20Thanks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2231001%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EIntune%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2385956%22%20slang%3D%22en-US%22%3ERe%3A%20Report%20on%20a%20device's%20recent%20check-ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2385956%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1006504%22%20target%3D%22_blank%22%3E%40nicklatronica%3C%2FA%3E%26nbsp%3BTry%20using%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FdeviceManagement%2FmanagedDevices%3Ffilter%3Ddevicename%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fbeta%2FdeviceManagement%2FmanagedDevices%3Ffilter%3Ddevicename%3C%2FA%3E%20eq%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20beta%20version%20of%20the%20graph%20API%20returns%20a%20hash%20table%20that%20has%20the%20last%20checkin%20userid%20and%20time.%3C%2FP%3E%3CP%3EJust%20found%20this%20myself%20as%20I%20was%20looking%20for%20the%20same%20thing%20as%20you.%3C%2FP%3E%3CP%3EHope%20this%20is%20helpfull.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3EDoug%20Gelling%3C%2FP%3E%3CP%3ENorrcom%20ICT%20Support%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2386151%22%20slang%3D%22en-US%22%3ERe%3A%20Report%20on%20a%20device's%20recent%20check-ins%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2386151%22%20slang%3D%22en-US%22%3EHI%2C%3CBR%20%2F%3E%3CBR%20%2F%3ESomething%20like%20this%3F%3CBR%20%2F%3E%3CBR%20%2F%3Econnect-msgraph%3CBR%20%2F%3E%3CBR%20%2F%3EGet-IntuneManagedDevice%20%7C%20Where-Object%20%7B%24_.operatingSystem%20-match%20%22Windows%22%7D%20%7C%20select-object%20*%20%7C%20sort-object%20userdisplayname%20%7C%20Out-GridView%3C%2FLINGO-BODY%3E
Occasional Visitor

I have the need to run a report for all of our corporate devices in Intune to show the most recent checked-in user.  Right now, the only place I see the info is if we use the Intune for Education portal.  When you go to the  record,  under details you see:  Properties, Device Actions, Recent check-ins

 

I haven't been able to find anywhere to report on that field - have tried graph explorer and PowerShell.  The data must exist somewhere, any help you can provide would be appreciated.  

 

PS - this is similar to a thread from 2019, but no solution was found, thought I would bring it back up.  Thanks

 

4 Replies

@nicklatronica Try using this:

 

https://graph.microsoft.com/beta/deviceManagement/managedDevices?filter=devicename eq

 

The beta version of the graph API returns a hash table that has the last checkin userid and time.

Just found this myself as I was looking for the same thing as you.

Hope this is helpfull.

 

Regards

Doug Gelling

Norrcom ICT Support

HI,

Something like this?

connect-msgraph

Get-IntuneManagedDevice | Where-Object {$_.operatingSystem -match "Windows"} | select-object * | sort-object userdisplayname | Out-GridView
Hi Rudy, that will only report the devices primary user, not the last person to checkin.
You would need this:

install-module Microsoft.Graph.Intune (if not already done)
Update-MSGraphEnvironment -Schema beta -AppId 00000000-0000-0000-0000-000000000000
connect-msgraph
$Users=Get-IntuneManagedDevice -Filter "deviceName eq 'xxxxxxx'" |Select usersloggedon
foreach ($user in $Users.usersloggedon | sort -Descending lastLogOnDateTime) {
$user.userid
}
Of course you will then need to translate the userid to a display name.

Regards
Doug
Hi,

Ah I forget the update-MSGraphEnvironment part, you would need this indeed

Update-MSGraphEnvironment -Schema beta -AppId 00000000-0000-0000-0000-000000000000