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...
NPGHSHelpdesk
Copper Contributor
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
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 27, 2021
Hi,
Ah I forget the update-MSGraphEnvironment part, you would need this indeed
Update-MSGraphEnvironment -Schema beta -AppId 00000000-0000-0000-0000-000000000000
Ah I forget the update-MSGraphEnvironment part, you would need this indeed
Update-MSGraphEnvironment -Schema beta -AppId 00000000-0000-0000-0000-000000000000