Forum Discussion

nicklatronica's avatar
nicklatronica
Copper Contributor
Mar 23, 2021

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 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

 

  • HI,

    Something like this?

    connect-msgraph

    Get-IntuneManagedDevice | Where-Object {$_.operatingSystem -match "Windows"} | select-object * | sort-object userdisplayname | Out-GridView
    • NPGHSHelpdesk's avatar
      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
      • Rudy_Ooms_MVP's avatar
        Rudy_Ooms_MVP
        MVP
        Hi,

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

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

Resources