Exchange Online cmdlets (Get-AcceptedDomain, Get-Mailbox, …) emit a cryptic
“term not recognized” error when called without a session.
This helper checks
for an active connection up front and tells the caller to run
Connect-ExchangeOnline first, mirroring the Graph connection check used
elsewhere in the module.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.