Forum Discussion
nicklatronica
Mar 23, 2021Copper Contributor
Report on a device's recent check-ins
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 por...
May 25, 2021
HI,
Something like this?
connect-msgraph
Get-IntuneManagedDevice | Where-Object {$_.operatingSystem -match "Windows"} | select-object * | sort-object userdisplayname | Out-GridView
Something like this?
connect-msgraph
Get-IntuneManagedDevice | Where-Object {$_.operatingSystem -match "Windows"} | select-object * | sort-object userdisplayname | Out-GridView
- NPGHSHelpdeskMay 26, 2021Copper ContributorHi 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- May 26, 2021Hi,
Ah I forget the update-MSGraphEnvironment part, you would need this indeed
Update-MSGraphEnvironment -Schema beta -AppId 00000000-0000-0000-0000-000000000000