Pull Name, SMTP, OU and last logon time from Exchange 2013

Pull Name, SMTP, OU and last logon time from Exchange 2013

This script enables you to pull together the Name, Primary SMTP Address, Organizational Unit and Last Logon Time information.  This information can be useful if you are trying to find out which mailboxes are being used or not.  This script has been tested on Exchange 2013 only.

Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, PrimarySMTPAddress, OrganizationalUnit, @{label=”LastLogonTime”;expression={(Get-MailboxStatistics $_).LastLogonTime}}