Exchange Online PowerShell Commands
The ExchangeOnlineManagement module: mailboxes, permissions, transport and mail flow in Microsoft 365.All Exchange Online PowerShell pages
- Connect-ExchangeOnline -AppId -CertificateThumbprint -Organization (app-only, unattended scripts)Connect to Exchange Online PowerShell without a user: register an app with Exchange.ManageAsApp, add a certificate, assign a role, pass AppId and thumbprint.
- Convert a user mailbox to a shared mailbox: Set-Mailbox -Type SharedSet-Mailbox -Identity user@contoso.com -Type Shared converts a mailbox and keeps all mail. Then remove the license if under 50 GB and block the sign-in.
- Exchange Online: grant FullAccess, SendAs and SendOnBehalf permissions with PowerShellFullAccess uses Add-MailboxPermission, Send As uses Add-RecipientPermission, Send on Behalf uses Set-Mailbox -GrantSendOnBehalfTo. Add, check, remove each.
- Get-MessageTraceV2: message trace in Exchange Online PowerShellGet-MessageTraceV2 searches 90 days of mail, 10 days per query, up to 5000 results. Filter by sender, recipient or status; page with StartingRecipientAddress.
- Set-MailboxAutoReplyConfiguration: set an out-of-office reply for another mailboxSet an automatic reply with Set-MailboxAutoReplyConfiguration -AutoReplyState Enabled or Scheduled, internal and external messages and -ExternalAudience.