Listing Office 365 Endpoints using PowerShell

An essential part of a successful deployment of Office 365 is to make sure connectivity is optimal and that there are no restrictions being applied for the public endpoints of the service among other factors. this is all detailed on the Office 365 Network Connectivity Principles documentation.

A good overview of the concept was delivered at Ignite 2019 – BRK3000 – Strategies for building effective, optimal and future proof connectivity to Office 365 that will delight your users

One of the tasks is to read the list of the endpoints from the Office 365 URLs and IP address ranges documentation page, due the dynamic nature of the endpoint list a Web Service was made available to ease automation, reporting and 3rd party solutions.

Most of the times, you’ll just want to fetch the list of the URLs, and hand them over to your friendly networking team that would then do their magic. lucky enough PowerShell can be used to get that list easily, here’s an  example:

$endpoints = Invoke-WebRequest "https://endpoints.office.com/endpoints/worldwide?clientrequestid=b10c5ed1-bad1-445f-b386-b919946339a7" | ConvertFrom-Json ; $endpoints | ?{$_.serviceArea -eq "Common" -AND $_.Required -eq "True"} | select urls -ExpandProperty Urls

This would request the full list of endpoints from the web service, convert it PowerShell objects from Json and output only the Common Services which are also tagged as Required and list only the Urls.

Another example would be to pull the Optimize category:

$endpoints = Invoke-WebRequest "https://endpoints.office.com/endpoints/worldwide?clientrequestid=b10c5ed1-bad1-445f-b386-b919946339a7" | ConvertFrom-Json ; $endpoints | ?{$_.category -eq "Optimize" }

Enjoy!

Intune On-Premises Exchange Connector Log

Just a quick note for everyone missing the log files location of Microsoft Intune On-Premises Exchange Connector, seems like there is no documentation on where those files exists. and they are very useful for debugging this component.

This info came from a support case I’ve had with the on-premises connector 🙂

Anyhow:

  • Log files are here – C:\ProgramData\Microsoft\Windows Intune Exchange Connector\
  • If you wish to enable verbose tracing for more advanced debugging do the following:
  1. Open the Exchange Connector tracing configuration file. The file is located at: %ProgramData%\Microsoft\Windows Intune Exchange Connector\TracingConfiguration.xml
  2. Locate the TraceSourceLine with the following key: OnPremisesExchangeConnectorService
  3. Change the SourceLevel node value from Warning ActivityTracing (the default) to Verbose ActivityTracing.
<TraceSourceLine>
      <Key xsi:type="xsd:string">OnPremisesExchangeConnectorService</Key>
      <Value xsi:type="TraceSource">
        <SourceLevel>All</SourceLevel>
        <Listeners>
          <Listener>
            <ListenerType>CircularTraceListener</ListenerType>
            <SourceLevel>Verbose ActivityTracing</SourceLevel>
            <FileSizeQuotaInBytes>10000000</FileSizeQuotaInBytes>
            <FileName>Microsoft\Windows Intune Exchange Connector\Logs\Connector.svclog</FileName>
            <FileQuota>30</FileQuota>
          </Listener>
        </Listeners>
      </Value>
    </TraceSourceLine>

It is important to note that the ActivityTracing setting should remain or be included with ANY value that is set for the setting.

enjoy