O365 migration – List Exchange info including SMTP addresses and mailbox access

Have been doing a number of cut-over migrations from on-premises Exchange server (SBS usually) to Office365, and it is very handy to have a list of all the defined SMTP addresses for each user, along with who has full access to which mailboxes etc, to ease the setup within the O365 portal.

These PowerShell scripts output lists in CSV format.

All SMTP Addresses:

Get-Recipient | Select Name -ExpandProperty EmailAddresses | Select Name, SmtpAddress | Export-csv c:\temp\AllSMTPAddress.csv

All mailboxes that have full access assigned to other users (and who those users are!):

Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne “NT AUTHORITY\SELF” -and $_.IsInherited -eq $false} | Select Identity,User,@{Name=’Access Rights’;Expression={[string]::join(‘, ‘, $_.AccessRights)}} | Export-Csv -NoTypeInformation c:\MailboxPermissions.csv

All mailboxes with size info (in MB and number of items):

Get-Mailbox -ResultSize Unlimited | Sort DisplayName | Select-Object DisplayName, @{label=”TotalItemSize(MB)”;expression={(Get-MailboxStatistics $_).TotalItemSize.Value.ToMB()}}, @{label=”ItemCount”;expression={(Get-MailboxStatistics $_).ItemCount}} | Export-Csv “c:\UserMailboxSizes.csv” -NoTypeInformation

NOTE: If you are using EXO v2 (Exchange Online PowerShell v2) you will need to replace the Get-MailboxStatistics commands in the above code with Get-EXOMailboxStatistics.

Related Posts

Need IT Help?

If you need assistance please feel free to reach out to us.