IT Support
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
this is what it SHOULD produce
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 * -restrictdomainstocertific ate $false -RequireTls $true -SenderIPAddresses 52.48.127.192/26, 52.58.62.192/26, 52.58.63.0/25 -RestrictDomainsToIPAddres ses $true -DetectSenderIPRecipientLi st $true -connectortype partner -detectsenderipbyskippingl astip $false -cloudservicesmailenabled $false
Remove-PSSession $Session
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
this is what it SHOULD produce
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 * -restrictdomainstocertific
Remove-PSSession $Session
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nice!
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