Commands for Retrieving SMTP Domains

Asked By 0 points N/A Posted on -

I have problems with my hosted Exchange 2010. When creating a new organization, the parameter domain name will also be created but it is best to rename your organization to avoid any errors. Now, what I want to know is how can I get all the existing SMTP domains for all the organizations on Exchange? What are the commands to use in order to retrieve all the information needed? Help please.

Answered By 0 points N/A #113337

Commands for Retrieving SMTP Domains


Dear Adam Farrow,


Very interesting query. I researched on this and was able to locate a very useful command which not only gives you the SMTP addresses but also list of all mailboxes, server names,Primary smtp address, and additional smtp address(if any).

This script is to be used with the power shell.

The command is without quotations

“Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}”

Now let us discuss the commands:

 Get-mailbox-ResultSize Unlimited   here you call / get all the mailboxes, and then we get DisplayName, ServerName, PrimarySMTPAddress and also again script to gather all other smtp addresses. The Primary smtp address is with a block SMTP.

You can add  ” | Export-Csv <csv file> –NoTypeInformation” to save the results


Do read the article to get better idea for such scripting.



Login/Register to Answer

Related Questions