Office 365 – Get Last Logon Date

Are you paying for Office 365 licences that aren’t being used? In this post I will go over how I see who has used their mailbox and the last time it was logged into so I am then able to target those and see whether they still need them, freeing up valuable licences.

I have created a script which will be attached to the bottom of this post which you are free to use at will.

You will need to connect to Exchange Online before running this script, if you need to know how to do that you can find the guide a wrote here.

Navigate to where you saved the script to, in my case it’s in C:\Office365 and issue ./Office365-LastLogonStats.ps1

It will then show give you status updates, in this case it’s currently fetching mailboxes.

It’s now processing all mailboxes within the EXO tenant. Seeing when the mailbox was created and the last logon date was.

On completion it will output the csv file to the same location as where the script is stored.


Download “Office365-LastLogonStats.ps1” Office365-LastLogonStats.ps1 – Downloaded 458 times – 3 KB

Be the first to comment on "Office 365 – Get Last Logon Date"

Leave a comment

Your email address will not be published.


*