Jump to content
Toggle menu
  • 51 articles
  • 24 files
  • 4 users
  • 750 edits
Tech-Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Most useful PowerShell commands for Exchange

From Tech-Wiki


Common PowerShell starting points for supported Exchange Server and Exchange Online administration.

ⓘ
Validation status
Reviewed against current Microsoft Exchange PowerShell documentation on 27 September 2026. Legacy Office 365 MSOnline and Basic-auth remote-PowerShell examples have been removed.
!
Use Exchange RBAC and change control
Exchange cmdlets can affect mail flow, mailbox access, retention and availability. Use the least-privileged Exchange role required and validate bulk changes before applying them.

Exchange Server

Useful discovery commands:

Get-ExchangeServer
Get-MailboxDatabase -Status
Get-MailboxDatabaseCopyStatus *
Get-Mailbox -ResultSize Unlimited |
    Select-Object DisplayName,UserPrincipalName,PrimarySmtpAddress

Remote Exchange Server PowerShell

$Credential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange `
    -ConnectionUri http://mail01.example.com/PowerShell/ `
    -Authentication Kerberos `
    -Credential $Credential
Import-PSSession $Session -DisableNameChecking

Remove the session when finished:

>_Disconnect the on-premises session
Remove-PSSession $Session

Exchange Online

Use the Exchange Online PowerShell module and modern authentication:

>_Connect to Exchange Online
Install-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName [email protected]
>_Disconnect
Disconnect-ExchangeOnline

Permission examples

>_Review mailbox permissions
Get-MailboxPermission [email protected]
>_Grant Full Access
Add-MailboxPermission [email protected] -User [email protected] -AccessRights FullAccess -InheritanceType All

Official references