IT Praktyk Blog

Make Exchange Hybrid Admin Life Easier - part 1

Posted June 18, 2016; Last update June 26, 2016

Introduction

When you start using Office 365 in an enterprise environment you need be sure that users and your internal servers (e.g. when you maintain hybrid Exchange Server) are reachable and network traffic between them is not proxied.

The list of network requirements is published by Microsoft as the article ‘Office 365 URLs and IPs address ranges’ published here. The part of that article is the list of hosts for what network traffic need to be allowed and shouldn’t be proxied. The list is the O365IPAddresses.xml XML file and contains Office 365 subservices (e.g. comons used for managing and, Exchange Online, etc.) and IPs and URLs used to deliver them.

A XML format from its nature is not easily human readable. If you would like work with that data the file need to be downloaded, stored on a disk and opened in Excel but that required manual (so boring and prone to errors) job.

To make my life easier I wrote the PowerShell function ConvertFrom-O365AddressesXMLFIle.ps1. The function is intended for downloading and converting - to the custom PowerShell object - the list of hosts used for Office 365 services published as the O365IPAddresses.xml file.

You can download the function from Microsoft TechNet Gallery.

Action

To use function you need to:

To see demo of using ConvertFrom-O365AddressesXMLFIle.ps1 you can watch video published on my YouTube channel.

Results

Result 1

If you run the function in PowerShell console without any parameter


ConvertFrom-O365AddressesXMLFIle

as the result the custom PowerShell object will is returned - like on the screenshot below.

Because custom PowerShell object is returned - as should be for any decent PowerShell function - you can pipe it to other PowerShell cmdlet e.g. Export-CSV.

Result 2

Additionally on the disk will be stored the XML file with the name like O365IPAddresses-yyyyMMdd-HHmmss.xml (where the ‘yyyyMMdd-HHmmss’ is date and time where function was run).

Result 3

The function supports also converting the file previously downloaded to a disk - the parameter Path is used for that. By default is checked a relative path ‘.\O365IPAddresses.xml’ but also any file system path can be used like


ConvertFrom-O365AddressesXMLFIle -Path C:\O365IPAddresses.xml\O365IPAddresses-20160618-211703.xml

Summary

Using ConvertFrom-O365AddressesXMLFIle.ps1 function you can

Remarks

Updates