Link to home
Start Free TrialLog in
Avatar of IT Support
IT SupportFlag for United Kingdom of Great Britain and Northern Ireland

asked on

create 365 mailflow connector in powershell problem...

trying to make connector in 365 using a powershell script but cannot get it to make the connector use ip address range instead of domain for "how to identify your partner organisation"

there seems to be no documented way of doing it from the syntax of the command "New-InboundConnector" found here

https://docs.microsoft.com/en-us/powershell/module/exchange/mail-flow/new-inboundconnector?view=exchange-ps


so i am stumped. would love to know how to do it please...

***PLEASE NOTE I REALISE THAT THE SCRIPT DOES NOT ENABLE THE CONNECTOR*****

my script is as below currently.

this is what it produces   User generated image
this is what it SHOULD produce User generated image
Set-ExecutionPolicy RemoteSigned -Force

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session



New-InboundConnector -Enable $False -Name "kevs test" -SenderDomains * -restrictdomainstocertificate $false  -RequireTls  $true -SenderIPAddresses  52.48.127.192/26, 52.58.62.192/26, 52.58.63.0/25 -RestrictDomainsToIPAddresses $true -DetectSenderIPRecipientList $true -connectortype partner -detectsenderipbyskippinglastip $false -cloudservicesmailenabled $false



Remove-PSSession $Session
Avatar of FOX
FOX
Flag of United States of America image

Hello,
If you are trying to enable the connector you have to set it to True.  Your command has it set to False
Your command:   New-InboundConnector -Enable $False
Avatar of IT Support

ASKER

hi, no, i realise that thanks. i want it off until i know it does what i want it to do.  as i was at apins to point out, the script does not produce the right connector options
ASKER CERTIFIED SOLUTION
Avatar of IT Support
IT Support
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Nice!