If you are preparing to move from Exchange on premises to Office 365, it is good to know what mailboxes are in used what mailboxes have not been accessed over a period of time.
This will help you to organize and prioritize what mailboxes would need to move first or even this would help you to do some clean up if your company does not have an user life cycle process in place
If you need to find what mailboxes have not been accessed in the last three months run the following command. make sure you run this within the Exchange Management Shell or load the Exchange Module in PowerShell
get-mailbox | select-object name, WhenChanged | Where-Object {$_.WhenChanged -lt (Get-Date).AddMonths(-3)}