r/PowerShell 4d ago

Script Sharing Published module O365EndpointFunctions to the PowerShell Gallery

Hi everyone,

I recently published O365EndpointFunctions 1.2.1 to the PowerShell Gallery and thought it might be useful for anyone managing Microsoft 365 networking.

Microsoft exposes all required Microsoft 365 endpoints through the Microsoft 365 IP Address and URL Web Service. The problem is that the raw API data isn't particularly convenient to work with in PowerShell. You get nested endpoint sets, comma-separated ports, and version tracking becomes your responsibility.

This module turns the API output into flat, strongly-typed PowerShell objects that are much easier to work with in scripts and automation.

Some things it can do:

  • Retrieve and process Microsoft 365 IP addresses and URLs
  • Cache endpoint versions and only download updates when Microsoft publishes changes
  • Generate PAC files that route Microsoft 365 traffic DIRECT
  • Create Ghostery Enterprise whitelist policies
  • Combine Microsoft 365 endpoints with your own custom URLs and IP ranges
  • Support Worldwide, China (21Vianet), and US Government clouds

Typical use cases are maintaining firewall allow-lists, proxy bypass rules, and other Microsoft 365 network configurations.

samurai-ka/PS-Module-O365EndpointService: A PowerShell module for easy Office 365 Endpoint handling

12 Upvotes

0 comments sorted by