Office 365 endpoints management:

You can use the new web Service provided by Microsoft:

Notice that the current XML file and old RSS feed will be available until October 2nd, 2018

A PowerShell script can be used to query the Web service:

The extract of this PS script can be generated in different format (i.e.  JSON, CSV, txt…)


Other reference articles:

Did you see on the top of the URL below:

Else using PowerShell scripts: