Why use this template?
Use this PowerShell template when you need to export mail contact metadata. It is generated locally and can be reviewed before you run it yourself in your own PowerShell session.
The template uses ExchangeOnlineManagement and requires View-Only Recipients. Output: CSV report. Level: Beginner. Action: Read-only. Risk: Low.
Review before running
The script is generated in your browser. Read it before you run it, and test it outside production first. “Read-only” describes the script itself; anything you add around it can still change data.
Generate the script
- Open the template in the PowerShell Builder.
- Enter the requested values and review the module, permissions, output and risk.
- Generate the script, read it carefully, and test it outside production before use.
The script is generated locally in your browser. Nothing needs to be uploaded to Opselith.
Generate Export Exchange mail contacts →Use this report to inventory mail-enabled contacts that represent recipients outside your Exchange Online organization.
When this helps
- Review external recipient objects before migration or directory cleanup.
- Compare primary SMTP and ExternalEmailAddress values for unexpected routing targets.
- Find contacts that are hidden from address lists and need separate business validation.
How to read the result
- A mail contact is a mail-enabled Exchange recipient object that points to an external email address; it is not an Exchange Online mailbox.
- The exported address fields show configured routing identity, not proof that the external destination is still owned, reachable or required.
Things to check
- Confirm the business owner before removing an apparently old contact.
- This report does not test external mail delivery and does not change contact properties.
What to do next: Validate unfamiliar external addresses with the service or business owner before changing or deleting any contact.
Related tasks
Official references