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

asked on

365 mailflow connector script suddenly stopped working

365 mailflow connector script suddenly stopped working - it used to work, now it works except for the inbound connector. i havent changed anything...any ideas please?

here is my script


<#

Get-InboundConnector | fl
 #>

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 $True -Name "HES INBOUND CONNECTOR" -SenderDomains * -restrictdomainstocertificate $false  -RequireTls  $true -SenderIPAddresses  52.48.127.192/26, 52.58.62.192/26, 52.58.63.0/25 -RestrictDomainsToIPAddresses $false -DetectSenderIPRecipientList $true -connectortype partner -detectsenderipbyskippinglastip $false -cloudservicesmailenabled $false 


New-outboundConnector -Enable $True -name "HES OUTBOUND CONNECTOR" -usemxrecord $false -connectortype partner -smarthosts relay.hes.trendmicro.eu -tlssettings certificatevalidation -istransportrulescoped $true -routeallmessagesviaonpremises $false -cloudservicesmailenabled $false -allaccepteddomains $false 


new-transportrule -enable $True -name "ONLY ACCEPT INBOUND MAIL FROM HES" -mode enforce -senderaddresslocation Header -fromscope notinorganization -exceptifsenderipranges 52.48.127.192/26, 52.58.62.192/26, 52.58.63.0/25 -deletemessage $true

new-transportrule -enable $True -name "DISABLE 365 SPAM FILTER" -mode enforce -senderaddresslocation Header -setscl -1 -senderipranges 52.48.127.192/26, 52.58.62.192/26, 52.58.63.0/25

new-transportrule -enable $True -name "HES OUTBOUND RULE" -mode enforce -senttoscope notInOrganization -HasNoClassification $False -HasSenderOverride $False -ExceptIfHasNoClassification $False -RouteMessageOutboundConnector  "HES OUTBOUND CONNECTOR"





<# need to make sure spf hard check is off in spam filter manually#>

Remove-PSSession $Session

Open in new window



all other lines work fine, and the connectors and rles are added just fine, but it now throws this error and the inbound connector doesnt get added.  any ideas please???

ModuleType Name                      ExportedCommands                                                          
---------- ----                      ----------------                                                          
Script     tmp_6cfc6321-5b3d-4007... {Get-DeviceComplianceDetailsReportFilter, Get-IRMConfiguration, New-Mail...
A positional parameter cannot be found that accepts argument '-DetectSenderIPRecipientList'.
    + CategoryInfo          : InvalidArgument: (:) [New-InboundConnector], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,New-InboundConnector
ASKER CERTIFIED SOLUTION
Avatar of Vasil Michev (MVP)
Vasil Michev (MVP)
Flag of Bulgaria 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
Avatar of IT Support

ASKER

it hasnt worked for about 6 months, it used to work prior to that.  maybe its been deprecated.

anyways, thanks for that - i will ditch that parameter and see what happens on the next migration...

thanks again.