Wednesday, April 16, 2014

Everyday Powershell - Part 19 - Migrate Transport Rules from Exchange 2007 to 2013

Today's script is a quick and dirty fix for a project we're in the middle of. Not really a script either, but it's the thought that counts.

#on a computer with exchange 2007 management tools
Add-PSSnapin *exchange*
export-transportrulecollection c:\scripts\exch2007transportrules.xml

#on a computer with exchange 2013 management tools
Add-PSSnapin *exchange*
[Byte[]]$Data = Get-Content -Path '\\someserver\c$\Scripts\exch2007transportrules.xml' -Encoding Byte -ReadCount 0
Import-TransportRuleCollection -FileData $Data
Export transport rules from Exchange 2007 and import them to 2013. 

To think our System Admin was going to copy these over by hand!

Full credit to Microsoft for this one it is all from