Created
August 22, 2016 19:06
-
-
Save flagranterror/b0d8e7baf52e18ec4af241bef4d440ea to your computer and use it in GitHub Desktop.
List Exchange Online netblocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ruby | |
require 'net/http' | |
require 'nokogiri' | |
response = Net::HTTP.get_response(URI.parse('https://support.content.office.net/en-us/static/O365IPAddresses.xml')) | |
xml = Nokogiri::XML(response.body) | |
xml.xpath("//product[@name='EXO']/addresslist[@type='IPv4']/address").each { |a| puts a.text } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment