Exports Exchange Online Accepted Domains configuration and (optionally) runs domain DNS health checks (MX/SPF/DKIM/DMARC/MTA) and exports everything to CSV.
- PowerShell 7 compatible
- Designed for Microsoft 365 consulting / auditing
- Best-effort approach: continues when some checks/cmdlets/modules are not available
This project is based on the original work by Ernesto Cobos Roqueñí.
Original script inspiration and implementation:
The original script was adapted and significantly extended to support:
- Exchange Online consulting and audit scenarios
- PowerShell 7 compatibility
- Execution logging and structured output
- PASS / FAIL authentication posture analysis (SPF, DKIM, DMARC)
- Multi-tenant friendly execution
Many thanks for the original idea and implementation.
- Retrieves
Get-AcceptedDomainfrom Exchange Online - Optionally performs DNS checks per accepted domain:
- MX lookup (via
Resolve-DnsNamewhen available) - SPF / DKIM / DMARC / MTA (via
DomainHealthCheckermodule)
- MX lookup (via
- Exports a single CSV with both configuration and analysis fields
- PowerShell 7+
- ExchangeOnlineManagement module (script imports it; can optionally install it)
- Permissions to connect to Exchange Online and run
Get-AcceptedDomain - Optional (for DNS checks):
DomainHealthCheckermodule
.\Export-AcceptedDomainsConfig.ps1 -OutputPath .\AcceptedDomains.csv