Posted in
Exchange Server,
Windows Powershell |
No Comment | 8,216 views | 26/07/2011 23:14
If you have an MTA, you have to configure Send-Connector to use that MTA as a smarthost. If that MTA is yours, then you can set relay on that server for your Exchange servers. But what about 3rd party MTA providers like DynDNS? They give you username/password for Basic Authentication and you can’t send email without that credentials. So we also need to set Basic Authentication on Send-Connector but how? Because Hosted Exchange 2010 SP1 has no GUI and Powershell requires System.Management.Automation.PSCredential to accept your credentials. I’ll show you how to solve this.
1
2
3
| $SecurePassword = ConvertTo-SecureString "PASSWORD_HERE" -AsPlainText -Force
$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "USERNAME_HERE", $SecurePassword
Get-SendConnector "SEND_CONNECTOR_HERE" | Set-SendConnector -DNSRoutingEnabled $false -SmartHosts 'SMARTHOST_HERE' -SmartHostAuthMechanism 'BasicAuth' -UseExternalDNSServersEnabled $false -AuthenticationCredential $Credentials |
$SecurePassword = ConvertTo-SecureString "PASSWORD_HERE" -AsPlainText -Force
$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "USERNAME_HERE", $SecurePassword
Get-SendConnector "SEND_CONNECTOR_HERE" | Set-SendConnector -DNSRoutingEnabled $false -SmartHosts 'SMARTHOST_HERE' -SmartHostAuthMechanism 'BasicAuth' -UseExternalDNSServersEnabled $false -AuthenticationCredential $Credentials
For example you have an MTA service from DynDNS and your information:
Host: smtp.dyndns.org
Username: yusufozturk
Password: password
Default Send Connector: Internet Connector
So you should use this script for that informations:
1
2
3
| $SecurePassword = ConvertTo-SecureString "password" -AsPlainText -Force
$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "yusufozturk", $SecurePassword
Get-SendConnector "Internet Connector" | Set-SendConnector -DNSRoutingEnabled $false -SmartHosts 'smtp.dyndns.org' -SmartHostAuthMechanism 'BasicAuth' -UseExternalDNSServersEnabled $false -AuthenticationCredential $Credentials |
$SecurePassword = ConvertTo-SecureString "password" -AsPlainText -Force
$Credentials = new-object -typename System.Management.Automation.PSCredential -argumentlist "yusufozturk", $SecurePassword
Get-SendConnector "Internet Connector" | Set-SendConnector -DNSRoutingEnabled $false -SmartHosts 'smtp.dyndns.org' -SmartHostAuthMechanism 'BasicAuth' -UseExternalDNSServersEnabled $false -AuthenticationCredential $Credentials
After this changes, you will be able to use your MTA.