So you want to clean up unused (shared) mailboxes in your Exchange (Online) environment. How to find out which mailboxes have been inactive for a long time? The answer is yet simple again, with a cool Power Shell script.
With a few additions you can check all your mailboxes in your environment. With the get-mailbox command we will retrieve a list of all mailboxes. By looping through we should get the result for all users in a good readable format.