Bulk add SMTP domains to your Exchange 2007 Server

During testing or experimentation, you may wish to add a list of SMTP domains for which your Exchange organization is authoritative.  This cmdlet assumes you have a text file, with one SMTP domain per line, called ‘domains.txt’  Note that the cmdlet has been wrapped in this post.

Get-Content c:scriptsdomains.txt | Foreach-Object {New-AcceptedDomain -Name $_ -DomainName $_ -DomainType Authoritative}

Typically you would run this cmdlet on a server that holds the Hub Transport role.  Then the EdgeSync process would automatically push this list out to the Edge servers.  Note that the list of accepted SMTP domains replicates once per hour by default.  If you want to sync immediately, issue the following command on the Hub Transport server (this assumes that you’ve already setup an Edgesync subscription):

Start-EdgeSynchronization