Recreate default receive connectors in Exchange Server

 https://www.alitajran.com/recreate-default-receive-connectors-exchange-server/


There are 5 default Exchange Server receive connectors on Exchange Server 2013/2016/2019. These receive connectors are automatically created when you install Exchange Server. Sometimes, you have to recreate the default receive connectors because you adjusted something, and mail flow isn’t working anymore. In this article, you will learn how to recreate the default receive connectors in Exchange Server.

Exchange Server default receive connectors

Exchange servers use receive connectors to control inbound SMTP connections from:

  1. Messaging servers that are external to the Exchange organization.
  2. Services in the transport pipeline on the local Exchange server or on remote Exchange servers.
  3. Email clients that need to use authenticated SMTP to send messages.

Read more about Exchange Server receive connectors:

Let’s look at the receive connectors in Exchange Server. Sign in to Exchange admin center and navigate to mail flow > receive connectors.

The 5 default Exchange Server receive connectors on Exchange Server are:

  1. Client Frontend
  2. Client Proxy
  3. Default
  4. Default Frontend
  5. Outbound Proxy Frontend
Recreate default receive connectors in Exchange Server list

Recreate default receive connectors

To recreate the default receive connectors in Exchange admin center, go through the screens below and ensure that you configure the same configuration for each receive connector.

Client Frontend receive connector

To recreate the Client Frontend receive connector, go through the below configuration:

General

Client Frontend receive connector general

Security

Client Frontend receive connector security

Scoping

Client Frontend receive connector scoping

Client Proxy receive connector

To recreate the Client Proxy receive connector, go through the below configuration:

General

Client Proxy receive connector general

Security

Client Proxy receive connector security

Scoping

Client Proxy receive connector scoping

Default receive connector

To recreate the Default receive connector, go through the below configuration:

General

Default receive connector general

Security

Default receive connector security

Scoping

Default receive connector scoping

Default Frontend receive connector

To recreate the Default Frontend receive connector, go through the below configuration:

General

Default Frontend receive connector general

Security

Default Frontend receive connector security

Scoping

Default Frontend receive connector scoping

Outbound Proxy Frontend receive connector

To recreate the Outbound Proxy Frontend receive connector, go through the below configuration:

General

Default Outbound Proxy Frontend receive connector general

Security

Default Outbound Proxy Frontend receive connector security

Scoping

Default Outbound Proxy Frontend receive connector scoping

In the next step, we will show how to recreate the default receive connectors with a PowerShell script.

Recreate default receive connectors PowerShell script

To recreate the default receive connectors in Exchange Server with a PowerShell script, follow the steps below.

Step 1. Download Set-ReceiveConnectors PowerShell script

Download and place Set-ReceiveConnectors.ps1 PowerShell script on the Exchange Server C:\scripts folder. If you don’t have a scripts folder, create one.

Ensure the file is unblocked to prevent errors when running the script. Read more in the article Not digitally signed error when running PowerShell script.

Another option is to copy and paste the code below into Notepad. Give it the name Set-ReceiveConnectors.ps1 and place it in the C:\scripts folder.

<#
    .SYNOPSIS
    Set-ReceiveConnectors.ps1

    .DESCRIPTION
    Recreate the default Receive Connectors on the Exchange Server.

    .LINK
    www.alitajran.com/recreate-default-receive-connectors-exchange-server

    .NOTES
    Written by: ALI TAJRAN
    Website:    www.alitajran.com
    LinkedIn:   linkedin.com/in/alitajran

    .CHANGELOG
    V1.00, 09/25/2023 - Initial version
    V1.10, 10/15/2024 - Added parameter for server name
#>

param (
    [Parameter(Mandatory = $true)]
    [string]$ServerName
)

# Define IP Range
$range = "0.0.0.0-255.255.255.255", "::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"

# Check if the server with the specified name exists
$targetServer = Get-ExchangeServer -Identity $ServerName -ErrorAction SilentlyContinue

if ($targetServer) {
    # Define connector parameters for splatting
    $clientProxyParams = @{
        Name              = "Client Proxy $ServerName"
        Bindings          = "0.0.0.0:465", "[::]:465"
        AuthMechanism     = "Tls", "Integrated", "BasicAuth", "BasicAuthRequireTLS", "ExchangeServer"
        RemoteIPRanges    = $range
        TransportRole     = "HubTransport"
        PermissionGroups  = "ExchangeUsers", "ExchangeServers"
        MaxMessageSize    = "35MB"
        MessageRateLimit  = 5
        MessageRateSource = "User"
        EnableAuthGSSAPI  = $true
        Server            = $ServerName
    }

    $defaultFrontendParams = @{
        Name                 = "Default Frontend $ServerName"
        Bindings             = "0.0.0.0:25", "[::]:25"
        AuthMechanism        = "Tls", "Integrated", "BasicAuth", "BasicAuthRequireTLS", "ExchangeServer"
        RemoteIPRanges       = $range
        TransportRole        = "FrontendTransport"
        PermissionGroups     = "AnonymousUsers", "ExchangeServers", "ExchangeLegacyServers"
        MaxMessageSize       = "36MB"
        DomainSecureEnabled  = $true
        ProtocolLoggingLevel = "Verbose"
        Server               = $ServerName
    }

    $outboundProxyFrontendParams = @{
        Name                 = "Outbound Proxy Frontend $ServerName"
        Bindings             = "0.0.0.0:717", "[::]:717"
        AuthMechanism        = "Tls", "Integrated", "BasicAuth", "BasicAuthRequireTLS", "ExchangeServer"
        RemoteIPRanges       = $range
        TransportRole        = "FrontendTransport"
        PermissionGroups     = "ExchangeServers"
        MaxMessageSize       = "36MB"
        DomainSecureEnabled  = $true
        ProtocolLoggingLevel = "Verbose"
        Server               = $ServerName
    }

    $clientFrontendParams = @{
        Name              = "Client Frontend $ServerName"
        Bindings          = "0.0.0.0:587", "[::]:587"
        AuthMechanism     = "Tls", "Integrated", "BasicAuth", "BasicAuthRequireTLS"
        RemoteIPRanges    = $range
        TransportRole     = "FrontendTransport"
        PermissionGroups  = "ExchangeUsers"
        MaxMessageSize    = "35MB"
        MessageRateLimit  = 5
        MessageRateSource = "User"
        EnableAuthGSSAPI  = $true
        Server            = $ServerName
    }

    $defaultParams = @{
        Name                                    = "Default $ServerName"
        Bindings                                = "[::]:2525", "0.0.0.0:2525"
        AuthMechanism                           = "Tls", "Integrated", "BasicAuth", "BasicAuthRequireTLS", "ExchangeServer"
        RemoteIPRanges                          = $range
        TransportRole                           = "HubTransport"
        PermissionGroups                        = "ExchangeUsers", "ExchangeServers", "ExchangeLegacyServers"
        MaxMessageSize                          = "35MB"
        MaxInboundConnectionPerSource           = "Unlimited"
        MaxInboundConnectionPercentagePerSource = 100
        MaxRecipientsPerMessage                 = 5000
        SizeEnabled                             = "EnabledWithoutValue"
        Server                                  = $ServerName
    }

    # Check and create connectors if they don't exist
    $connectors = @{
        "Client Proxy"            = $clientProxyParams
        "Default Frontend"        = $defaultFrontendParams
        "Outbound Proxy Frontend" = $outboundProxyFrontendParams
        "Client Frontend"         = $clientFrontendParams
        "Default"                 = $defaultParams
    }

    foreach ($connectorName in $connectors.Keys) {
        $connectorParams = $connectors[$connectorName]
        if (!(Get-ReceiveConnector | Where-Object { $_.Name -eq $connectorParams.Name -and $_.Server -eq $ServerName })) {
            $null = New-ReceiveConnector @connectorParams
            Write-Host "$connectorName Connector created successfully." -ForegroundColor Green
        }
        else {
            Write-Host "$connectorName Connector already exists." -ForegroundColor Yellow
        }
    }
}
else {
    Write-Host "Server '$ServerName' not found. Please provide a valid Exchange Server name." -ForegroundColor Red
}

Step 2. Remove the default receive connectors

It’s important to remove the default receive connector you want to recreate. Suppose you only want to recreate one of them, then only remove that specific default receive connector.

In our example, we will remove all the default receive connectors because we like to recreate them all.

Recreate default receive connectors in Exchange Server remove

Step 3. Run the Set-ReceiveConnector PowerShell script

Start Exchange Management Shell as administrator and run the Set-ReceiveConnectors.ps1 PowerShell script to recreate the default receive connectors.

C:\scripts\.\Set-ReceiveConnectors.ps1 -ServerName "EX01-2019"

The script will show if:

  1. If the default receive connector already exists, it will move on to the next default receive connector.
  2. If the default receive connector does not exist, it will create a new default receive connector with the correct settings.
  3. If the wrong Exchange Server name is set, the script will show that you need to enter a valid Exchange Server name.
Client Proxy Connector created successfully.
Default Frontend Connector created successfully.
Outbound Proxy Frontend Connector created successfully.
Client Frontend Connector created successfully.
Default Connector created successfully.

Step 4. Verify default receive connectors

Verify that the default receive connectors are successfully created in Exchange Server.

Recreate default receive connectors in Exchange Server verify

That’s it!

Read more: Configure postmaster address in Exchange Server »

Conclusion

You learned how to recreate default receive connectors in Exchange Server. If you have issues with inbound mail flow or made changes to the default Exchange Server receive connectors and want to set it back to its original configuration, recreate them. Recreate the receive connectors in Exchange admin center or with the PowerShell script.

Did you enjoy this article? You may also like Find IP addresses using Exchange SMTP relay. Don’t forget to follow us and share this article.

Комментарии

Популярные сообщения из этого блога

У вас нет прав для отправки сообщения вместо указанного пользователя. Ошибка: [0x80070005-0x0004dc-0x000524]

Пустое значение виртуального каталога Autodiscover - Object reference not set to an instance of an object (Get-AutodiscoverVirtualDirectory)

KSMG Подготовка конфигурационных файлов для подключения к LDAP