Forum Discussion
nimby
Mar 24, 2020Copper Contributor
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...
kathy
Brass Contributor
Yes. What Vasil said was correct - LastLogonTime from Get-MailBoxStatistics shows wrong value.
To get all users last activity time/real last logon time, you can use this script: Export Office 365 users Real Last Logon Time Report to CSV
nimby
Mar 25, 2020Copper Contributor
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)