Commands › Exchange Online

Get-MailboxFolder

Exchange Online ExchangeOnlineManagement Get-*

View folders in your own mailbox. Administrators can't use this cmdlet to view folders in other mailboxes (the cmdlet is available only from the MyBaseOptions user role).

Quick start script

# Get-MailboxFolder — 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-MailboxFolder -GetChildren <SwitchParameter> -Recurse <SwitchParameter> | Format-List

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

Syntax — 2 parameter sets

GetChildren

Get-MailboxFolder [[-Identity] <MailboxFolderIdParameter>]
 [-GetChildren]
 [-DomainController <Fqdn>]
 [-MailFolderOnly]
 [-ResultSize <Unlimited>]
 [<CommonParameters>]

Recurse

Get-MailboxFolder [[-Identity] <MailboxFolderIdParameter>]
 [-Recurse]
 [-DomainController <Fqdn>]
 [-MailFolderOnly]
 [-ResultSize <Unlimited>]
 [<CommonParameters>]

Parameters (6)

ParameterTypeRequiredWhat it controls
-Identity MailboxFolderIdParameter The Identity parameter specifies the mailbox folder that you want to view. The syntax is `[MailboxID]:[\ParentFolder][\SubFolder]`.
-GetChildren SwitchParameter yes The GetChildren switch specifies whether to return only the first level of subfolders under the specified parent folder. You don't need to specify a value with this switch.
-Recurse SwitchParameter yes The Recurse switch specifies whether to return the specified parent folder and all of its subfolders. You don't need to specify a value with this switch.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-MailFolderOnly SwitchParameter The MailFolderOnly switch specifies whether to return only the mail folders in the specified mailbox. You don't need to specify a value with this switch.
-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.

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.