├── Copy-ReceiveConnector.ps1 ├── LICENSE.md └── README.md /Copy-ReceiveConnector.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .SYNOPSIS 3 | Copy a selected receive connector and it's configuration and permissions to other Exchange Servers 4 | 5 | Thomas Stensitzki 6 | 7 | THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE 8 | RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER. 9 | 10 | Version 1.7, 2020-03-15 11 | 12 | Please submit ideas, comments, and suggestions using GitHub. 13 | 14 | .LINK 15 | http://scripts.granikos.eu 16 | 17 | .DESCRIPTION 18 | 19 | This script copies a receive connector from a source Exchange Server to a single target Exchange server or to all Exchange servers. 20 | 21 | Configured permissions are copied as well, if required. 22 | 23 | .NOTES 24 | 25 | Requirements 26 | - Windows Server 2016, Windows Server 2019 27 | - Exchange Server 2013/2016/2019 Management Shell 28 | 29 | Revision History 30 | -------- ----------------------------------------------------------------------- 31 | 1.0 Initial community release 32 | 1.1 Domain Controller parameter added, permissions group copy added 33 | 1.2 Move to FrontendTransport added, optional permission copy added, reset bindings added 34 | 1.3 Update receive connector, if receive connector exists 35 | 1.4 Fix to handle connector updates properly 36 | 1.41 Minor fixes and update for Exchange 2016 37 | 1.5 Issue #2 fixed 38 | 1.6 Issue #3 fixed 39 | 1.6.1 Minor fixes and tested with Exchange Server 2019 40 | 1.7 UpdateExistingConnector added (issue #6), tested with Exchange Server 2019 41 | 42 | .PARAMETER ConnectorName 43 | Name of the connector the new IP addresses should be added to 44 | 45 | .PARAMETER SourceServer 46 | Name of the receive connector to copy 47 | 48 | .PARAMETER TargetServer 49 | Target Exchange server to copy the selected receive connector to 50 | 51 | .PARAMETER DomainController 52 | Domain Controller name 53 | 54 | .PARAMETER CopyToAllOther 55 | Switch to copy to all other Exchange servers 56 | 57 | .PARAMETER CopyPermissions 58 | Copy non inherited source receive AD permissions to target receive connector. Inherited permissions will not be copied 59 | 60 | .PARAMETER MoveToFrontend 61 | Change source connector transport role to FrontendTransport. This is required when you copy a receive connector from Exchange 2007 to Exchange 2013 62 | 63 | .PARAMETER ResetBindings 64 | Do not copy bindings but reset receive connector network bindings to 0.0.0.0:25 65 | 66 | .PARAMETER UpdateExistingConnector 67 | Update an existing receive connector without confirmation prompt. 68 | 69 | .PARAMETER ViewEntireForest 70 | View entire Active Directory forest 71 | 72 | .EXAMPLE 73 | 74 | Copy Exchange 2013/2016/2019 receive connector MYRECEIVECONNECTOR from server MBX01 to server MBX2 75 | 76 | .\Copy-ReceiveConnector.ps1 -SourceServer MBX01 -ConnectorName MYRECEIVECONNECTOR -TargetServer MBX2 -DomainController MYDC1.mcsmemail.de 77 | 78 | .EXAMPLE 79 | 80 | Copy Exchange 2013/2016/2019 receive connector MYRECEIVECONNECTOR from server MBX01 to all other Exchange 2013+ servers 81 | 82 | .\Copy-ReceiveConnector.ps1 -SourceServer MBX01 -ConnectorName MYRECEIVECONNECTOR -CopyToAllOther -DomainController MYDC1.mcsmemail.de 83 | 84 | .EXAMPLE 85 | 86 | Copy Exchange 2013/2016/2019 receive connector MYRECEIVECONNECTOR from server MBX01 to all other Exchange 2013+ servers without confirmation prompt if connectors already exists 87 | 88 | .\Copy-ReceiveConnector.ps1 -SourceServer MBX01 -ConnectorName MYRECEIVECONNECTOR -CopyToAllOther -DomainController MYDC1.mcsmemail.de -UpdateExitingConnector 89 | 90 | .EXAMPLE 91 | 92 | Copy Exchange 2013/2016/2019 receive connector MYRECEIVECONNECTOR from Exchange 2010 server MBX2010 to Exchange 2016 server MBX01, make it a FrontEnd-Connector, and reset network bindings 93 | 94 | .\Copy-ReceiveConnector.ps1 -SourceServer MBX2010 -ConnectorName MYRECEIVECONNECTOR -TargetServer MBX01 -MoveToFrontend -ResetBindings -DomainController MYDC1.mcsmemail.de 95 | #> 96 | 97 | param( 98 | [parameter(Mandatory,HelpMessage='Source Exchange server to copy from')] 99 | [string]$SourceServer, 100 | [parameter(Mandatory,HelpMessage='Name of the source receive connector')] 101 | [string]$ConnectorName, 102 | [string]$TargetServer = '', 103 | [parameter(Mandatory,HelpMessage='Domain Controller name')] 104 | [string]$DomainController = '', 105 | [switch]$CopyToAllOther, 106 | [switch]$CopyPermissions, 107 | [switch]$MoveToFrontend, 108 | [switch]$ResetBindings, 109 | [switch]$UpdateExitingConnector, 110 | [switch]$ViewEntireForest 111 | ) 112 | 113 | Import-Module -Name ActiveDirectory 114 | 115 | $sourceRC = $null 116 | $secondsToWait = 60 117 | 118 | ### FUNCTIONS ----------------------------- 119 | 120 | function Request-Choice { 121 | [CmdletBinding()] 122 | param( 123 | [string]$Caption = 'Really?' 124 | ) 125 | $choices = [System.Management.Automation.Host.ChoiceDescription[]]@('&Yes','&No') 126 | 127 | [int]$defaultChoice = 1 128 | 129 | $choiceReturn = $Host.UI.PromptForChoice($Caption, '', $choices, $defaultChoice) 130 | 131 | return $choiceReturn 132 | } 133 | 134 | function Copy-ToServer { 135 | [CmdletBinding()] 136 | param( 137 | [string]$TargetServerName = '' 138 | ) 139 | 140 | $ExchangeGroups = @('Externally Secured Servers','Edge Transport Servers','Hub Transport Servers','Exchange Servers','ExchangeLegacyInterop') 141 | 142 | if ($TargetServerName -ne '') { 143 | 144 | $sourceRC = Get-ReceiveConnector -Server $SourceServer -DomainController $DomainController | Where-Object{$_.Name -eq $ConnectorName} -ErrorAction SilentlyContinue 145 | 146 | $targetRC = Get-ReceiveConnector -Server $TargetServerName -DomainController $DomainController | Where-Object{$_.Name -eq $ConnectorName} -ErrorAction SilentlyContinue 147 | 148 | if(($sourceRC -ne $null) -and ($targetRC -eq $null)){ 149 | 150 | Write-Host ('Working on [{0}] and receive connector [{1}]' -f $TargetServerName.ToUpper(), $ConnectorName) 151 | 152 | # clear permission groups for Exchange Server 2013 (thanks to Jeffery Land, https://jefferyland.wordpress.com) 153 | $tempPermissionGroups = @($sourceRC.PermissionGroups) -split ', ' | Select-String -Pattern 'Custom' -NotMatch 154 | $temp = (('{0}' -f $tempPermissionGroups)).Replace(' ', ', ').Replace(' ','') 155 | 156 | if($temp -ne '') { 157 | $sourceRC.PermissionGroups = $temp 158 | } 159 | 160 | if($MoveToFrontend) { 161 | # Move receive connector to FrontEnd Transpport 162 | $sourceRC.TransportRole = 'FrontendTransport' 163 | } 164 | 165 | if($ResetBindings) { 166 | # Reset network bindungs to listen on all adapters using port 25 167 | $sourceRC.Bindings = '0.0.0.0:25' 168 | } 169 | 170 | $TargetFqdn = $sourceRC.Fqdn 171 | 172 | # Check if source fqdn contains server name fqdn 173 | if(([string]$sourceRC.Fqdn.Domain).ToLower().Contains([string]$sourceRC.Server.Name.ToLower())) { 174 | Write-Verbose -Message 'Source connector uses server Fqdn. Changing to target server Fqdn.' 175 | 176 | $TargetFqdn = ('{0}.{1}' -f $TargetServerName,(Get-ExchangeServer $TargetServerName).Domain.ToString()).ToLower() 177 | } 178 | 179 | $FixAuthMechanism = $false 180 | 181 | # change permission groups settings temporarily 182 | if(([string]$sourceRC.AuthMechanism).Split(',').Trim().Contains('ExternalAuthoritative')) { 183 | Write-Verbose -Message 'Connector is set to ExternalAuthoritative and needs special treatment.' 184 | 185 | # keep current source connector configuration 186 | $AuthMechanism = $sourceRC.AuthMechanism 187 | $PermissioNGroups = $sourceRC.PermissionGroups 188 | 189 | # set ExternalAuthoritative only 190 | # $sourceRC.AuthMechanism = 'ExternalAuthoritative' 191 | $sourceRC.PermissionGroups = 'ExchangeServers' 192 | 193 | $FixAuthMechanism = $true 194 | } 195 | 196 | # create new Receive Connector 197 | New-ReceiveConnector -Name $sourceRC.Name ` 198 | -TransportRole $sourceRC.TransportRole ` 199 | -RemoteIPRanges $sourceRC.RemoteIPRanges ` 200 | -Bindings $sourceRC.Bindings ` 201 | -Banner $sourceRC.Banner ` 202 | -ChunkingEnabled $sourceRC.ChunkingEnabled ` 203 | -DefaultDomain $sourceRC.DefaultDomain ` 204 | -DeliveryStatusNotificationEnabled $sourceRC.DeliveryStatusNotificationEnabled ` 205 | -EightBitMimeEnabled $sourceRC.EightBitMimeEnabled ` 206 | -DomainSecureEnabled $sourceRC.DomainSecureEnabled ` 207 | -LongAddressesEnabled $sourceRC.LongAddressesEnabled ` 208 | -OrarEnabled $sourceRC.OrarEnabled ` 209 | -Comment $sourceRC.Comment ` 210 | -Enabled $sourceRC.Enabled ` 211 | -ConnectionTimeout $sourceRC.ConnectionTimeout ` 212 | -ConnectionInactivityTimeout $sourceRC.ConnectionInactivityTimeout ` 213 | -MessageRateLimit $sourceRC.MessageRateLimit ` 214 | -MaxInboundConnection $sourceRC.MaxInboundConnection ` 215 | -MaxInboundConnectionPerSource $sourceRC.MaxInboundConnectionPerSource ` 216 | -MaxInboundConnectionPercentagePerSource $sourceRC.MaxInboundConnectionPercentagePerSource ` 217 | -MaxHeaderSize $sourceRC.MaxHeaderSize ` 218 | -MaxHopCount $sourceRC.MaxHopCount ` 219 | -MaxLocalHopCount $sourceRC.MaxLocalHopCount ` 220 | -MaxLogonFailures $sourceRC.MaxLogonFailures ` 221 | -MaxMessageSize $sourceRC.MaxMessageSize ` 222 | -MaxProtocolErrors $sourceRC.MaxProtocolErrors ` 223 | -MaxRecipientsPerMessage $sourceRC.MaxRecipientsPerMessage ` 224 | -PermissionGroups $sourceRC.PermissionGroups ` 225 | -PipeliningEnabled $sourceRC.PipeLiningEnabled ` 226 | -ProtocolLoggingLevel $sourceRC.ProtocolLoggingLevel ` 227 | -RequireEHLODomain $sourceRC.RequireEHLODomain ` 228 | -RequireTLS $sourceRC.RequireTLS ` 229 | -EnableAuthGSSAPI $sourceRC.EnableAuthGSSAPI ` 230 | -ExtendedProtectionPolicy $sourceRC.ExtendedProtectionPolicy ` 231 | -SizeEnabled $sourceRC.SizeEnabled ` 232 | -TarpitInterval $sourceRC.TarpitInterval ` 233 | -EnhancedStatusCodesEnabled $sourceRC.EnhancedStatusCodesEnabled ` 234 | -Server $TargetServerName ` 235 | -AuthMechanism $sourceRC.AuthMechanism ` 236 | -Fqdn $TargetFqdn ` 237 | -DomainController $DomainController 238 | 239 | if($FixAuthMechanism) { 240 | 241 | Write-Verbose -Message ('Wait {0} seconds for domain controller to update' -f $secondsToWait) 242 | Start-Sleep -Seconds $secondsToWait 243 | 244 | $newConnector = Get-ReceiveConnector -Identity ('{0}\{1}' -f $TargetServerName, $sourceRC.Name) -DomainController $DomainController 245 | 246 | Write-Verbose -Message ('Updating PermissionGroups for {0}\{1}' -f $TargetServerName, $sourceRC.Name) 247 | 248 | $newConnector | Set-ReceiveConnector -PermissionGroups $PermissionGroups 249 | 250 | } 251 | 252 | if($CopyPermissions) { 253 | # fetch non inherited permissons from source connector 254 | $sourcePermissions = Get-ReceiveConnector -Identity $sourceRC -DomainController $DomainController | Get-ADPermission | Where-Object {$_.IsInherited -eq $false} 255 | 256 | # we wait some time for domain controller to get stuff done 257 | Write-Host ('Wait {0} seconds for domain controller to update' -f $secondsToWait) 258 | Start-Sleep -Seconds $secondsToWait 259 | 260 | Write-Verbose -Message 'Adding AD permissions' 261 | 262 | # set access rights on target connector 263 | $null = Get-ReceiveConnector -Identity ('{0}\{1}' -f $TargetServerName, $sourceRC.Name) -DomainController $DomainController | Add-ADPermission -DomainController $DomainController -User $_.User -Deny:$_.Deny -AccessRights $_.AccessRights -ExtendedRights $_.ExtendedRights -ErrorAction SilentlyContinue 264 | 265 | Write-Verbose -Message 'Adding AD permissions finished' 266 | } 267 | } 268 | elseif($sourceRC -ne $null) { 269 | 270 | # target connector already exists 271 | Write-Output 'Target connector already exists.' 272 | 273 | if(($UpdateExitingConnector) -or (Request-Choice -Caption ('Do you want to UPDATE the receive connector {0} on server {1}?' -f $ConnectorName, $TargetServerName)) -eq 0) { 274 | 275 | Write-Host ('Updating connector on server {0}' -f $TargetServerName) 276 | 277 | # clear permission groups for Exchange Server 2013 (thanks to Jeffery Land, https://jefferyland.wordpress.com) 278 | $tempPermissionGroups = @($sourceRC.PermissionGroups) -split ', ' | Select-String -Pattern 'Custom' -NotMatch 279 | $temp = (('{0}' -f $tempPermissionGroups)).Replace(' ', ', ').Replace(' ','') 280 | 281 | if($temp -ne '') { 282 | $sourceRC.PermissionGroups = $temp 283 | } 284 | 285 | $TargetFqdn = $sourceRC.Fqdn 286 | 287 | # Check if source fqdn contains server name fqdn 288 | if(([string]$sourceRC.Fqdn.Domain).ToLower().Contains([string]$sourceRC.Server.Name.ToLower())) { 289 | Write-Verbose -Message 'Source connector uses server Fqdn. Changing to target server Fqdn.' 290 | 291 | $TargetFqdn = ('{0}.{1}' -f $TargetServerName,(Get-ExchangeServer $TargetServerName).Domain.ToString()).ToLower() 292 | } 293 | 294 | Get-ReceiveConnector -Identity ('{0}\{1}' -f ($TargetServerName), $sourceRC.Name) | Set-ReceiveConnector ` 295 | -RemoteIPRanges $sourceRC.RemoteIPRanges ` 296 | -Banner $sourceRC.Banner ` 297 | -ChunkingEnabled $sourceRC.ChunkingEnabled ` 298 | -DefaultDomain $sourceRC.DefaultDomain ` 299 | -DeliveryStatusNotificationEnabled $sourceRC.DeliveryStatusNotificationEnabled ` 300 | -EightBitMimeEnabled $sourceRC.EightBitMimeEnabled ` 301 | -DomainSecureEnabled $sourceRC.DomainSecureEnabled ` 302 | -LongAddressesEnabled $sourceRC.LongAddressesEnabled ` 303 | -OrarEnabled $sourceRC.OrarEnabled ` 304 | -Comment $sourceRC.Comment ` 305 | -Enabled $sourceRC.Enabled ` 306 | -ConnectionTimeout $sourceRC.ConnectionTimeout ` 307 | -ConnectionInactivityTimeout $sourceRC.ConnectionInactivityTimeout ` 308 | -MessageRateLimit $sourceRC.MessageRateLimit ` 309 | -MaxInboundConnection $sourceRC.MaxInboundConnection ` 310 | -MaxInboundConnectionPerSource $sourceRC.MaxInboundConnectionPerSource ` 311 | -MaxInboundConnectionPercentagePerSource $sourceRC.MaxInboundConnectionPercentagePerSource ` 312 | -MaxHeaderSize $sourceRC.MaxHeaderSize ` 313 | -MaxHopCount $sourceRC.MaxHopCount ` 314 | -MaxLocalHopCount $sourceRC.MaxLocalHopCount ` 315 | -MaxLogonFailures $sourceRC.MaxLogonFailures ` 316 | -MaxMessageSize $sourceRC.MaxMessageSize ` 317 | -MaxProtocolErrors $sourceRC.MaxProtocolErrors ` 318 | -MaxRecipientsPerMessage $sourceRC.MaxRecipientsPerMessage ` 319 | -PermissionGroups $sourceRC.PermissionGroups ` 320 | -PipeliningEnabled $sourceRC.PipeLiningEnabled ` 321 | -ProtocolLoggingLevel $sourceRC.ProtocolLoggingLevel ` 322 | -RequireEHLODomain $sourceRC.RequireEHLODomain ` 323 | -RequireTLS $sourceRC.RequireTLS ` 324 | -EnableAuthGSSAPI $sourceRC.EnableAuthGSSAPI ` 325 | -ExtendedProtectionPolicy $sourceRC.ExtendedProtectionPolicy ` 326 | -SizeEnabled $sourceRC.SizeEnabled ` 327 | -TarpitInterval $sourceRC.TarpitInterval ` 328 | -EnhancedStatusCodesEnabled $sourceRC.EnhancedStatusCodesEnabled ` 329 | -AuthMechanism $sourceRC.AuthMechanism ` 330 | -Fqdn $TargetFqdn 331 | 332 | if($CopyPermissions) { 333 | 334 | # fetch non inherited permissons from source connector 335 | $sourcePermissions = Get-ReceiveConnector -Identity $sourceRC | Get-ADPermission | Where-Object {$_.IsInherited -eq $false} 336 | 337 | # we wait some time for domain controller to get stuff done 338 | Write-Host ('Wait {0} seconds for domain controller to update' -f $secondsToWait) 339 | Start-Sleep -Seconds $secondsToWait 340 | 341 | Write-Verbose -Message 'Adding AD permissions' 342 | 343 | # set access rights on target connector 344 | $sourcePermissions | ForEach-Object { 345 | $null = Get-ReceiveConnector -Identity ('{0}\{1}' -f $TargetServerName, $sourceRC.Name) -DomainController $DomainController | Add-ADPermission -DomainController $DomainController -User $_.User -Deny:$_.Deny -AccessRights $_.AccessRights -ExtendedRights $_.ExtendedRights 346 | } 347 | } 348 | } 349 | } 350 | else { 351 | Write-Host 'There seems to be an issue with the source connector information provided.' 352 | Write-Host ('Source connector {0}\{1} cannot be accessed or does not exist!' -f $SourceServer, $ConnectorName) 353 | } 354 | } 355 | else { 356 | Write-Verbose -Message 'No target server name specified' 357 | } 358 | } 359 | 360 | function Copy-ToAllServers { 361 | Write-Verbose -Message 'Copy receive connector to all other Exchange 2013+ servers' 362 | 363 | # Quick fix for issue #3, assuming that you've deployed Exchange 2013 multi-role 364 | $frontendServers = Get-ExchangeServer | Where-Object{($_.AdminDisplayVersion.Major -eq 15) -and (([string]$_.ServerRole).Contains('Mailbox')) -and ($_.Name -ne $SourceServer)} | Sort-Object -Property Name 365 | 366 | foreach($server in $frontendServers){ 367 | Write-Output -InputObject ('Working on server: {0}' -f $server) 368 | Copy-ToServer -TargetServerName $server 369 | } 370 | 371 | Write-Verbose -Message 'Finished copying connector to all modern Exchange servers done' 372 | } 373 | 374 | ### MAIN ---------------------------------- 375 | 376 | if($ViewEntireForest) { 377 | Write-Verbose -Message ('Setting ADServerSettings -ViewEntireForest {0}' -f $true) 378 | Set-ADServerSettings -ViewEntireForest $true 379 | } 380 | 381 | if((-not $CopyToAllOther) -and ($TargetServer -eq '')){ 382 | Write-Output 'You need to either specific a dedicated target server using the -TargetServer ' 383 | Write-Output 'attribute or select the -CopyToAllOther switch' 384 | break 385 | } 386 | elseif($TargetServer -ne ''){ 387 | # Copy to a single Exchange server 388 | Copy-ToServer -TargetServerName $TargetServer 389 | } 390 | elseif($CopyToAllOther){ 391 | # Copy to all Exchange 2013/2016/2019 servers 392 | Copy-ToAllServers 393 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015-2022 Thomas Stensitzki 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Copy-ReceiveConnector.ps1 2 | 3 | Copy a selected receive connector and it's configuration and permissions to other Exchange Servers 4 | 5 | ## NOTE 6 | 7 | This repository is archived. The script is maintained [here](https://github.com/Apoc70/PowerShell-Scripts). 8 | 9 | ## Description 10 | 11 | This script copies a receive connector from a source Exchange Server to a single target Exchange server or to all Exchange servers. 12 | 13 | Configured permissions are copied as well, if required. 14 | 15 | ## Requirements 16 | 17 | - Windows Server 2016, Windows Server 2019 18 | - Exchange Server 2013/2016/2019 Management Shell 19 | 20 | ## Parameters 21 | 22 | ### ConnectorName 23 | 24 | Name of the connector the new IP addresses should be added to 25 | 26 | ### SourceServer 27 | 28 | Name of the receive connector to copy 29 | 30 | ### TargetServer 31 | 32 | Target Exchange server to copy the selected receive connector to 33 | 34 | ### DomainController 35 | 36 | Domain Controller name 37 | 38 | ### CopyToAllOther 39 | 40 | Switch to copy to all other Exchange servers 41 | 42 | ### CopyPermissions 43 | 44 | Copy non inherited source receive AD permissions to target receive connector. Inherited permissions will not be copied 45 | 46 | ### MoveToFrontend 47 | 48 | Change source connector transport role to FrontendTransport. This is required when you copy a receive connector from Exchange 2007 to Exchange 2013+ 49 | 50 | ### ResetBindings 51 | 52 | Do not copy bindings but reset receive connector network bindings to 0.0.0.0:25 53 | 54 | ### UpdateExistingConnector 55 | 56 | Update an existing receive connector without confirmation prompt. 57 | 58 | ### ViewEntireForest 59 | 60 | View entire Active Directory forest 61 | 62 | ## Examples 63 | 64 | ``` PowerShell 65 | .\Copy-ReceiveConnector.ps1 -SourceServer MBX01 -ConnectorName nikos-one-RC2 -TargetServer MBX2 -DomainController MYDC1.mcsmemail.de 66 | ``` 67 | 68 | Copy Exchange 2013 receive connector nikos-one-RC2 from server MBX01 to server MBX2 69 | 70 | ``` PowerShell 71 | .\Copy-ReceiveConnector.ps1 -SourceServer MBX01 -ConnectorName nikos-one-RC1 -CopyToAllOther -DomainController MYDC1.mcsmemail.de 72 | ``` 73 | 74 | Copy Exchange 2013 receive connector nikos-one-RC2 from server MBX01 to all other Exchange 2013 servers 75 | 76 | ``` PowerShell 77 | .\Copy-ReceiveConnector.ps1 -SourceServer MBX2007 -ConnectorName "varunagroup relay" -TargetServer MBX01 -MoveToFrontend -ResetBindings -DomainController MYDC1.mcsmemail.de 78 | ``` 79 | 80 | Copy Exchange 2013 receive connector "nikos-two relay" from Exchange 2007 server MBX2007 to Exchange 2013+ server MBX01 and reset network binding 81 | 82 | ``` PowerShell 83 | .\Copy-ReceiveConnector.ps1 -SourceServer MBX01 -ConnectorName MYRECEIVECONNECTOR -CopyToAllOther -DomainController MYDC1.mcsmemail.de -UpdateExitingConnector 84 | ``` 85 | 86 | Copy Exchange 2013/2016/2019 receive connector MYRECEIVECONNECTOR from server MBX01 to all other Exchange 2013+ servers without confirmation prompt if connectors already exists 87 | 88 | ## Note 89 | 90 | THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE 91 | RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER. 92 | 93 | ## Credits 94 | 95 | Written by: Thomas Stensitzki 96 | 97 | ## Stay connected 98 | 99 | - Blog: [http://blog.granikos.eu](http://blog.granikos.eu) 100 | - Twitter: [https://twitter.com/stensitzki](https://twitter.com/stensitzki) 101 | - LinkedIn: [http://de.linkedin.com/in/thomasstensitzki](http://de.linkedin.com/in/thomasstensitzki) 102 | - Github: [https://github.com/Apoc70](https://github.com/Apoc70) 103 | - MVP Blog: [https://blogs.msmvps.com/thomastechtalk/](https://blogs.msmvps.com/thomastechtalk/) 104 | - Tech Talk YouTube Channel (DE): [http://techtalk.granikos.eu](http://techtalk.granikos.eu) 105 | - Tech & Community Podcast (DE): [http://podcast.granikos.eu](http://podcast.granikos.eu) 106 | 107 | For more Microsoft 365, Cloud Security, and Exchange Server stuff checkout the services provided by Granikos 108 | 109 | - Website: [https://granikos.eu](https://granikos.eu) 110 | - Twitter: [https://twitter.com/granikos_de](https://twitter.com/granikos_de) 111 | --------------------------------------------------------------------------------