Forum Discussion
powershell creation receive connector from csv
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"
- 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/?WT.mc_id=M365-MVP-5002523
- 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/?WT.mc_id=M365-MVP-5002523- StefanoC66Iron ContributorYou’re right I overlooked it
Thanks
- randierikoCopper Contributoryou need to use -remoteipranges "ip1","ip2","ip3"
- StefanoC66Iron Contributor