May 8, 2013

Check last login activity date for an Office 365 or Exchange online user with Powershell command

Now that the latest update for Office 365 is rolling out to customers, I've seen some cool new features in the Dashboard area. For example there is a chart that is displayed that shows you how many of your users haven't logged into the system in the past 30 days or 90 days. Unfortunately it won't actually show you the names of those users so you can't really act on that information.

Here is a quick Powershell command that you can run that will give you a list of all of your users and display the date of the last time that they logged into the system:

Get-mailbox -resultsize unlimited| Get-MailboxStatistics | select displayname, lastlogontime

Note : If you need some help getting connected with Powershell, you can look at this earlier blog post of mine that tells you how to connect and run these commands.