New-ReceiveConnector : Cannot bind parameter 'RemoteIPRanges'.

Ella Taylor 80 Reputation points
2025-01-07T14:34:39.18+00:00

I'm trying to create a script that should create an exchange receive connector from a CSV file that contains the list of the connectors to create as well as some properties.

The problem is not the creation of the connector, which we can create from the csv, but the "remoteiprange" properties that throw an error.

The csv file has this format

"Name","Bindings","DeliveryStatusNotificationEnabled","AdminDisplayName","RemoteIPRanges","PermissionGroups" "TestConn","0.0.0.0:25","True","","192.168.101.0/23 192.168.102.0/23","AnonymousUsers, ExchangeServers, Custom"

 

So we read all the parameters from the file and try to create the new connector passing them to the command but the error we get is 

New-ReceiveConnector : Cannot bind parameter 'RemoteIPRanges'. Cannot convert value "192.168.101.0/23,192.168.102.0/23" to type "Microsoft.Exchange.Data.IPRange". Error: "The format of the IP address 192.168.101.0/23,192.168.102.0 is invalid. Example of a valid IP address: 192.168.1.10"

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,179 questions
{count} votes

Accepted answer
  1. Anonymous
    2025-01-08T05:26:24.6766667+00:00

    Hi,@Ella Taylor

    Thanks for posting your question in the Microsoft Q&A forum.

    The RemoteIPRanges parameter specifies the remote IP addresses that the Receive connector accepts messages from. Valid values are:

    Single IP address: For example, 192.168.1.1 or fe80::39bd:88f7:6969:d223%11.

    IP address range: For example, 192.168.1.1-192.168.1.254.

    Classless InterDomain Routing (CIDR) IP address range: For example, 192.168.1.1/24 or 2001:0DB8::CD3/60.

    You can specify multiple value separated by commas: "Value1","Value2",..."ValueN"

    https://learn.microsoft.com/en-us/powershell/module/exchange/new-receiveconnector?view=exchange-ps&viewFallbackFrom=exchange-ps%2F%3Fwt.mc_id%3Dm365-mvp-5002523


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Said A 911 Reputation points
    2025-01-07T20:15:36.9+00:00

    Hello,

    I think you simple need to tweak your script to respect the requirements mentioned here:

    -RemoteIPRanges The RemoteIPRanges parameter specifies the remote IP addresses that the Receive connector accepts messages from. Valid values are:

    • Single IP address: For example, 192.168.1.1 or fe80::39bd:88f7:6969:d223%11.
    • IP address range: For example, 192.168.1.1-192.168.1.254.
    • Classless InterDomain Routing (CIDR) IP address range: For example, 192.168.1.1/24 or 2001:0DB8::CD3/60. You can specify multiple value separated by commas: "Value1","Value2",..."ValueN".

    Source: https://learn.microsoft.com/en-us/powershell/module/exchange/new-receiveconnector?view=exchange-ps

    For example I would test re-trying the script with double quotes "192.168.101.0/23","192.168.102.0/23", if the is problematic I will try using ranges "192.168.1.1-192.168.1.254", "192.168.1.1-192.168.1.254"

    Goodluck!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.