Skip to main content

Exchange Online

PowerShell for administering Exchange Online with the ExchangeOnlineManagement module. Connect once (see Microsoft 365 — Overview & Connection) and every script here reuses the session.

Scripts​

Reading them together​

The first two are a pair. A mailbox-level audit finds a forward configured on a mailbox or a rule inside it; a transport-rule audit finds redirection applied across the whole tenant from the mail-flow layer. Running one without the other leaves a path open, and it is routinely the second one that is missed — a transport rule needs no access to any mailbox at all.

Tip — The connection is the slow part

Connect-ExchangeOnline takes several seconds and each script checks for an existing session with Get-ConnectionInformation before reconnecting. Run them in the same console and only the first pays the cost.