Forum Discussion

nimby's avatar
nimby
Copper Contributor
Mar 24, 2020

Last Logon time

Is there anyway to download via powershell the last login time for all users? Currently I'm using "Get-EXOMailboxStatistics" but this requires you to provide a username and only obtains the stats for this user, the problem being we have over 300,000 users so this takes nearly a week to run!!!!!

    • nimby's avatar
      nimby
      Copper Contributor

      kathy 

       

      Hi Kathy, 

       

      Thanks for your suggestion, but looking at this script I think I will hit the same issue as it looks like it makes a call to O365/Azure for each user:-

       

      Function Get_LastLogonTime 
      { 
       $MailboxStatistics=Get-MailboxStatistics -Identity $upn 

       I'm trying to find a way to request the stats for all users with a single call (or at least not 300,000+ calls)

       

       

    • nimby's avatar
      nimby
      Copper Contributor

      VasilMichev 

       

      Thanks for the feedback, obtain the data via the Graph API is fine, the problem is that we need to make a call for each user rather than requesting the info for all users. Is there anyway to do this in bulk and obtain the stats for all users in our Org? The root issue for us is that we need to make a call for each user.

      • Use the Graph call for the report then, it will give you the data for all users.

Resources