Tag Archives: exchange 2010

Extracting useful user information from Exchange 2010 with Powershell

Finishing a migration to Office 365 and want to send the client a list of remaining user mailboxes that need moving (or deleting!).

get-mailbox and get-mailboxstatistics both have their uses, but I really needed to use something that combined them both.

I found the solution at https://www.experts-exchange.com/questions/28399371/Combining-Get-Mail-Get-Mailboxstatistics-To-Pull-UsageLocation-LastLogonTime.html

And adapted it to my own means:

Get-Mailbox -ResultSize Unlimited | sort-object | Select-Object Name, primarysmtpaddress, @{n="Mailbox Size";e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.TotalItemSize}}, @{n="LastLogonTime";e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.LastLogonTime}} | Export-Csv C:\temp\LastLogonTime.csv

This outputs the User name, Primary SMTP Address from get-mailbox and Mailbox size (formatted to MB) and last logon time from get-mailboxstatistics.

Reconnecting an Office 365 mailbox with an on-premise user

Hybrid Office 365 setup. User account is created on-premise, AD is synced, and then the user is licenced as an Office 365 user. Exchange won’t create the Remote User forwarder, so the user will only receive email from Office 365 (and external if the MX record has been switched to Office 365).

You can join the account up with the command:

Enable-RemoteMailbox Username -RemoteRoutingAddress “username@tennent.mail.onmicrosoft.com”

That will create the Remote Mailbox on Exchange with the forwarder email address.