Create RULES and Outbound connector using PowerShell ISE

Created by Abderrahim Ibnou el kadi, Modified on Tue, 21 Sep 2021 at 10:35 AM by Abderrahim Ibnou el kadi


This KB is meant to show you the process of creating RULES and Connectors required to complete the configuration with Proofpoint Essentials (PPE). The process should not take you more than 3 minutes. If this does not work for whatever reason the you can create them manually <STEP1 to STEP6) as described <here>

Note: This KB is only for office 365 configuration.



Before you Start you need to:

  1. Make sure you have Windows PowerShell installed on the station/server you would like to run this from
  2. Run the POWERSHELL ISE as Administrator
  3. Click on one of the Icons in red square in the screen shot below to chose your preferred display
  4. Run this command 1st: Set-ExecutionPolicy RemoteSigned
  5. Copy the following commands directly to the PowerShell ISE Script Pane 

  • 1)---------------Provide office365 Admin credentials---------------------------------------------

$UserCredential = Get-Credential

  • 2)---------------------------Create a session ------------------------------------------------------

Write-Output "Getting The Exchange online cmdlets"

$Session=New-PSSession -ConnectionUri "


Microsoft.Exchange -Credential $UserCredential -Authentication Basic -AllowRedirection

  • 3)-------------------------------Import the session created above locally-------------------------

Import-PSSession $Session

  • 4)----------------------------Authenticate and connect to EXCH online Powershell V2----------

Connect-exchangeonline -credential $usercredential

  • 5)------------------------------Set the execution policy for the currect PowerShell session------

Set-ExecutionPolicy RemoteSigned

  • 6)-----------------------Create the RULE to Bypass PPE--------------------------------------------

New-TransportRule -Name "PPE ByPass Spam" -Priority 0 -SenderIpRanges,,,,,,,,,,,,,,,, -SetSCL -1

  • 7)------------------------Create a PPE LockDown Rule------------------------------------------------

New-TransportRule -Name "Office 365 Lock Down" -Enabled $false

-ExceptIfHeaderMatchesMessageHeader "X-MS-Exchange-MeetingForward-Message" 

-ExceptIfHeaderMatchesPatterns "Forward" -ExceptIfSenderIpRanges,,,,,,,,,,,,,,,, -FromScope NotInOrganization -Mode Enforce -RejectMessageReasonText "UnAuthorized IP" -SetAuditSeverity DoNotAudit

  • 8)-------------------------Create Outbound Connector-----------------------------------------------

New-OutboundConnector -Enabled $false -Name "ProofPoint Send Connector" -ConnectorType Partner

-TlsSettings CertificateValidation -RecipientDomains * -SmartHosts

-UseMXRecord $false

  • 9)-------------------------Validate the OutBound Connector created above--------------------------

Validate-OutboundConnector -Identity "ProofPoint Send Connector" -Recipient

6- So in the PowerShell select the command in each BLOCK  (from1 to 9) at a time, make sure they are a one liner command and click on the execute selection button  from the PowerShell menu. If you get prompted with Credentials make sure you enter the creds for the Admin on office365.

7- Check on Office 365 panel and make sure all the RULES and the outbound Connector are created correctly