Wednesday , June 19 2019

Export and Import Transport Rules in Exchange Online

Lets see in a hybrid in Environment. We got to move the transport Rules from On-Premises Server to Office 365. So that transport rules will still work when mail flow hits the cloud for Mail processing.

Export XML file from On premises Server –

$file = Export-TransportRuleCollection
Set-Content -Path "C:\Scripts\Rules.xml" -Value $file.FileData -Encoding Byte

image

Connect to Exchange Online PowerShell –

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

Import XML file to Office 365  –

[Byte[]]$Data = Get-Content -Path "C:\Scripts\Rules.xml" -Encoding Byte -ReadCount 0
Import-TransportRuleCollection -FileData $Data

Note : Import from Exchange 2010 Server is not Supported.  Error : It cannot be used with a engine-based XML File is Datacenter Environment.

image

About Satheshwaran Manoharan

Satheshwaran Manoharan is an Microsoft Office Server and Services MVP , Publisher of Azure365pro.com. Specialized in Office365 / Microsoft Exchange / Virtualization , Sathesh is an Messaging Expert supporting/Designing/Deploying many medium size businesses to large enterprises when it comes to Corporate messaging and Virtualization Infrastructure

Check Also

Only Android Phones getting Cert Error from Load Balancer

Bypassing load balancer seems to be no error. and iOS devices and Outlook seems to ...

Leave a Reply

Your email address will not be published.