Commands › Exchange Online

Get-Mailbox

Exchange Online ExchangeOnlineManagement Get-*

View mailbox objects and attributes, populate property pages, or supply mailbox information to other tasks. **Note**: In Exchange Online PowerShell, we recommend that you use the Get-EXOMailbox cmdlet instead of this cmdlet. For more information, see Connect to Exchange Online PowerShell.

Quick start script

# Get-Mailbox — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Get-Mailbox | Format-List

# 3. Export for evidence / drift tracking
Get-Mailbox | Export-Clixml .\Mailbox-$(Get-Date -Format yyyyMMdd).xml

Syntax — 5 parameter sets

AnrSet

Get-Mailbox [-Anr <String>]
 [-Arbitration]
 [-Archive]
 [-AuditLog]
 [-AuxAuditLog]
 [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-Filter <String>]
 [-GroupMailbox]
 [-IgnoreDefaultScope]
 [-InactiveMailboxOnly]
 [-IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromWithDisplayNames]
 [-IncludeEmailAddressDisplayNames]
 [-IncludeForwardingAddressWithDisplayNames]
 [-IncludeGrantSendOnBehalfToWithDisplayNames]
 [-IncludeInactiveMailbox]
 [-Migration]
 [-Monitoring]
 [-OrganizationalUnit <OrganizationalUnitIdParameter>]
 [-PublicFolder]
 [-ReadFromDomainController]
 [-RecipientTypeDetails <RecipientTypeDetails[]>]
 [-RemoteArchive]
 [-ResultSize <Unlimited>]
 [-SoftDeletedMailbox]
 [-SortBy <String>]
 [-SupervisoryReviewPolicy]
 [<CommonParameters>]

DatabaseSet

Get-Mailbox [-Database <DatabaseIdParameter>]
 [-Arbitration]
 [-Archive]
 [-AuditLog]
 [-AuxAuditLog]
 [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-Filter <String>]
 [-GroupMailbox]
 [-IgnoreDefaultScope]
 [-Migration]
 [-Monitoring]
 [-OrganizationalUnit <OrganizationalUnitIdParameter>]
 [-PublicFolder]
 [-ReadFromDomainController]
 [-RecipientTypeDetails <RecipientTypeDetails[]>]
 [-RemoteArchive]
 [-ResultSize <Unlimited>]
 [-SortBy <String>]
 [-SupervisoryReviewPolicy]
 [<CommonParameters>]

Identity

Get-Mailbox [[-Identity] <MailboxIdParameter>]
 [-Arbitration]
 [-Archive]
 [-AuditLog]
 [-AuxAuditLog]
 [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-Filter <String>]
 [-GroupMailbox]
 [-IgnoreDefaultScope]
 [-InactiveMailboxOnly]
 [-IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromWithDisplayNames]
 [-IncludeEmailAddressDisplayNames]
 [-IncludeForwardingAddressWithDisplayNames]
 [-IncludeGrantSendOnBehalfToWithDisplayNames]
 [-IncludeInactiveMailbox]
 [-Migration]
 [-Monitoring]
 [-OrganizationalUnit <OrganizationalUnitIdParameter>]
 [-PublicFolder]
 [-ReadFromDomainController]
 [-RecipientTypeDetails <RecipientTypeDetails[]>]
 [-RemoteArchive]
 [-ResultSize <Unlimited>]
 [-SoftDeletedMailbox]
 [-SortBy <String>]
 [-SupervisoryReviewPolicy]
 [<CommonParameters>]

ServerSet

Get-Mailbox [-Server <ServerIdParameter>]
 [-Arbitration]
 [-Archive]
 [-AuditLog]
 [-AuxAuditLog]
 [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-Filter <String>]
 [-GroupMailbox]
 [-IgnoreDefaultScope]
 [-Migration]
 [-Monitoring]
 [-OrganizationalUnit <OrganizationalUnitIdParameter>]
 [-PublicFolder]
 [-ReadFromDomainController]
 [-RecipientTypeDetails <RecipientTypeDetails[]>]
 [-RemoteArchive]
 [-ResultSize <Unlimited>]
 [-SortBy <String>]
 [-SupervisoryReviewPolicy]
 [<CommonParameters>]

1 more parameter sets — see the parameter table below.

Parameters (33)

ParameterTypeRequiredWhat it controls
-Identity MailboxIdParameter The Identity parameter specifies the mailbox that you want to view. You can use any value that uniquely identifies the mailbox. For example:
-Anr String The Anr parameter specifies a string on which to perform an ambiguous name resolution (ANR) search. You can specify a partial string and search for objects with an attribute that matches that string. The default...
-Arbitration SwitchParameter This parameter is available only in on-premises Exchange.
-Archive SwitchParameter The Archive switch specifies whether to return only mailboxes that have an archive enabled in the results. You don't need to specify a value with this switch.
-AuditLog SwitchParameter This parameter is available only in on-premises Exchange.
-AuxAuditLog SwitchParameter This parameter is available only in on-premises Exchange.
-Credential PSCredential This parameter is available only in on-premises Exchange.
-Database DatabaseIdParameter This parameter is available only in on-premises Exchange.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-Filter String The Filter parameter uses OPATH syntax to filter the results by the specified properties and values. The search criteria uses the syntax `"Property -ComparisonOperator 'Value'"`.
-GroupMailbox SwitchParameter The GroupMailbox switch specifies whether to return only Microsoft 365 Groups in the results. You don't need to specify a value with this switch.
-IgnoreDefaultScope SwitchParameter This parameter is available only in on-premises Exchange.
-InactiveMailboxOnly SwitchParameter This parameter is available only in the cloud-based service.
-IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeAcceptMessagesOnlyFromWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeEmailAddressDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeForwardingAddressWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeGrantSendOnBehalfToWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeInactiveMailbox SwitchParameter This parameter is available only in the cloud-based service.
-MailboxPlan MailboxPlanIdParameter This parameter is available only in the cloud-based service.
-Migration SwitchParameter The Migration switch specifies whether to return only migration mailboxes in the results. You don't need to specify a value with this switch.
-Monitoring SwitchParameter This parameter is available only in on-premises Exchange.
-OrganizationalUnit OrganizationalUnitIdParameter The OrganizationalUnit parameter filters the results based on the object's location in Active Directory. Only objects that exist in the specified location are returned. Valid input for this parameter is an...
-PublicFolder SwitchParameter The PublicFolder switch specifies whether to return only public folder mailboxes in the results. You don't need to specify a value with this switch.
-ReadFromDomainController SwitchParameter This parameter is available only in on-premises Exchange.
-RecipientTypeDetails RecipientTypeDetails[] The RecipientTypeDetails parameter filters the results by the specified mailbox subtype. Valid values are:
-RemoteArchive SwitchParameter This parameter is available only in on-premises Exchange.
-ResultSize Unlimited The ResultSize parameter specifies the maximum number of results to return. If you want to return all requests that match the query, use unlimited for the value of this parameter. The default value is 1000.
-Server ServerIdParameter This parameter is available only in on-premises Exchange.
-SoftDeletedMailbox SwitchParameter This parameter is available only in the cloud-based service.
-SortBy String The SortBy parameter specifies the property to sort the results by. You can sort by only one property at a time. The results are sorted in ascending order.
-SupervisoryReviewPolicy SwitchParameter This parameter is available only in on-premises Exchange.

Message Center changes mentioning this command

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.