Initial Configuration of Exchange 2010 with PowerShell

Please refer to the following PowerShell Script on how to configure some basic settings for Fresh installed Exchange 2010 Server (Single Server enviroment)

Rename the Mailbox Database

Get-MailboxDatabase | Set-Mailbox -Name LOCAL #Rename Mailbox Database

Add Accepted Domain and set it as default

New-AcceptedDomain -DomainName -DomainType Authoritative -Name
Set-AcceptedDomain -Identity -MakeDefault $true

Configure the Default Email Address Policy to include the newly added accpeted domain as default

Get-EmailAddressPolicy | Set-EmailAddressPolicy -EnabledPrimarySMTPAddressTemplate ""
Get-EmailAddressPolicy | Update-EmailAddressPolicy 

Configure SMTP Connector
Please sign up a free SMTP Account from SMTP2GO as smart host as the public IP Address in mylab are always blacklisted

Login to SMTP2GO, and allow our Public IP Address for SMTP Relay

$UserName = "[email protected]"
$Password = "5gpclhrSLvBF" | ConvertTo-SecureString -AsPlainText -Force 
$Credential = new-object -typename System.Management.Automation.PSCredential -ArgumentList $UserName,$Password
New-SendConnector -Internet -Name "SMTP Connector" -AddressSpaces * -SmartHosts -SmartHostAuthMechanism BasicAuth `
-AuthenticationCredential $Credential -Enabled $true

Enabled AnonymousUsers Permission for Default Receiver Connector – To be able to received Email

Get-ReceiveConnector | ? Bindings -like "*25*" | Set-ReceiveConnector -PermissionGroups AnonymousUsers,ExchangeUsers,ExchangeServers

Configure OWA, ECP, OAB, ActiveSync & EWS URL – For External Only

Get-OwaVirtualDirectory | Set-OwaVirtualDirectory -ExternalUrl $OWA_URL -DefaultDomain mylab -LogonFormat UserName 
Get-EcpVirtualDirectory | Set-EcpVirtualDirectory -ExternalUrl $ECP_URL
Get-ActiveSyncVirtualDirectory | Set-ActiveSyncVirtualDirectory -ExternalUrl $ActiveSync_URL
Get-OabVirtualDirectory | Set-OabVirtualDirectory -ExternalUrl $OAB_URL
Get-WebServicesVirtualDirectory | Set-WebServicesVirtualDirectory -ExternalUrl $EWS_URL

Enable Outlook Anywhere

Enable-OutlookAnywhere -Server AVT-EX10 -ExternalHostname -ClientAuthenticationMethod basic -SSLOffloading:$true

Obtain the Wildcard SSL Certificate from Let’s Encrypt and import the SSL Certificate to Exchange 2010

Get-ExchangeCertificate | ? Subject -like "***" | Enable-ExchangeCertificate -Services IIS

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top