Duplicate Receive Connector in Exchange 2013 to the other server

Duplicate Receive Connector in Exchange 2013 to the other server

While been extending and modifying my Exchange infrastructure, I was needed to duplicate Receive Connectors from one server to another. I wrote a simple template script for this task.

First, get the object of existing connector:

[PS] C:\Windows\system32>Get-ReceiveConnector -Server exch14

Identity                                Bindings                                Enabled
--------                                --------                                -------
EXCH14\Default Frontend EXCH14          {10.0.0.1:25}                       True
EXCH14\Default EXCH14                   {0.0.0.0:2525, [::]:2525}               True
EXCH14\Client Proxy EXCH14              {[::]:465, 0.0.0.0:465}                 True
EXCH14\Client Frontend EXCH14           {[::]:587, 0.0.0.0:587}                 True
EXCH14\Outbound Proxy Frontend EXCH14   {[::]:717, 0.0.0.0:717}                 True
EXCH14\SAP vHost Power Notifications    {0.0.0.0:25}                            True
EXCH14\Certificate Sending from scripts {0.0.0.0:25}                            True


[PS] C:\Windows\system32>$a = Get-ReceiveConnector -Server exch14

Assume we need to duplicate "EXCH14\SAP vHost Power Notifications" connector, which is element #5 in array $a:

[PS] C:\Windows\system32>$a[5]

Identity                                Bindings                                Enabled
--------                                --------                                -------
EXCH14\SAP vHost Power Notifications    {0.0.0.0:25}                            True

Now we can set the variable for the new server name and execute cmdlet to duplicate receive connector in Exchange 2013:

$NewServer = "new-server";

$a[5] | foreach {
New-ReceiveConnector –TransportRole $_.TransportRole -Name $_.Name -RemoteIPRanges $_.RemoteIPRanges -bindings $_.Bindings -Banner $_.Banner -ChunkingEnabled $_.ChunkingEnabled -DefaultDomain $_.DefaultDomain -DeliveryStatusNotificationEnabled $_.DeliveryStatusNotificationEnabled -EightBitMimeEnabled $_.EightBitMimeEnabled -DomainSecureEnabled $_.DomainSecureEnabled  -LongAddressesEnabled $_.LongAddressesEnabled -OrarEnabled $_.OrarEnabled -Comment $_.Comment -Enabled $_.Enabled -ConnectionTimeout $_.ConnectionTimeout -ConnectionInactivityTimeout $_.ConnectionInactivityTimeout -MessageRateLimit $_.MessageRateLimit -MaxInboundConnection $_.MaxInboundConnection -MaxInboundConnectionPerSource $_.MaxInboundConnectionPerSource -MaxInboundConnectionPercentagePerSource $_.MaxInboundConnectionPercentagePerSource -MaxHeaderSize $_.MaxHeaderSize -MaxHopCount $_.MaxHopCount -MaxLocalHopCount $_.MaxLocalHopCount -MaxLogonFailures $_.MaxLogonFailures -MaxMessageSize $_.MaxMessageSize -MaxProtocolErrors $_.MaxProtocolErrors -MaxRecipientsPerMessage $_.MaxRecipientsPerMessage -PermissionGroups $_.PermissionGroups -PipeliningEnabled $_.PipeLiningEnabled -ProtocolLoggingLevel $_.ProtocolLoggingLevel -RequireEHLODomain $_.RequireEHLODomain -RequireTLS $_.RequireTLS -EnableAuthGSSAPI $_.EnableAuthGSSAPI -ExtendedProtectionPolicy $_.ExtendedProtectionPolicy -SizeEnabled $_.SizeEnabled -TarpitInterval $_.TarpitInterval -Server $NewServer
}

That's it.

 

Tags: exchange (en), exchange 2013 (en)

PrintEmail

Add comment


Security code
Refresh