--- title: "Get-VEXFolder" description: "Returns folders added to Microsoft Exchange mailboxes. Product: Veeam Backup & Replication, Veeam Backup for Microsoft 365 Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License This cmdlet provides the followi" canonical: "https://helpcenter.veeam.com/docs/vbr/explorers_powershell/get-vexfolder.html" breadcrumb: "Veeam Explorers PowerShell Reference > Veeam Explorers PowerShell Reference > Veeam Explorer for Microsoft Exchange > Get-VEXFolder" dateModified: "2026-08-18" --- # Get-VEXFolder ## Short Description Returns folders added to Microsoft Exchange mailboxes. **Product**: Veeam Backup & Replication, Veeam Backup for Microsoft 365 **Product Edition**: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License ## Syntax This cmdlet provides the following parameter sets: ## Detailed Description This cmdlet returns folders added to Microsoft Exchange mailboxes. The cmdlet will return mailbox folders on which the user has owner permissions. ## Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Mailbox

Specifies a mailbox database. The cmdlet will return all mailboxes from this database.

Accepts the VEXMailbox object. To get this object, run the Get-VEXMailbox cmdlet.

VEXMailbox

True

0

True (ByValue)

Name

Specifies the name of the mailbox. The cmdlet will return the mailbox with this name.

String

False

1

False

Parent

Specifies a parent folder in the mailbox. The cmdlet will return subfolders of this parent folder.

Accepts the VEXFolder object.

VEXFolder

True

0

True (ByValue)

Recurse

Defines that the cmdlet will return the specified parent folder and all of its subfolders.

Default: False

SwitchParameter

False

Named

False

`` This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the [About Common Parameters](http://go.microsoft.com/fwlink/p/?LinkID=113216) section of Microsoft Docs. ## Output Object The cmdlet returns the [`VEXFolder`](vexfolder.md)`[]` array that contains folders added to Microsoft Exchange mailboxes. ## Examples ::: example ### Example 1. Getting Folders with Subfolders from Mailbox [For Veeam Backup & Replication] This example shows how to get all folders and subfolders from the `Sales` mailbox. ``` $session = Get-VBRExchangeItemRestoreSession $database = Get-VEXDatabase -Session $session -Name "DB_0754907780.edb" $mailbox = Get-VEXMailbox -Database $database -Name "Sales" Get-VEXFolder -Mailbox $mailbox -Recurse ``` Perform the following steps: 1. Get the mailbox: 1. Run the [`Get-VBRExchangeItemRestoreSession`](get-vbrexchangeitemrestoresession.md) cmdlet. Save the result to the `$session` variable. 2. Run the [`Get-VEXDatabase`](get-vexdatabase.md) cmdlet. Set the `$session` variable as the `Session` parameter value. Specify the `Name` parameter value. Save the result to the `$database` variable. 3. Run the [`Get-VEXMailbox`](get-vexmailbox.md) cmdlet. Set the `$database` variable as the `Database` parameter value. Specify the `Name` parameter value. Save the result to the `$mailbox` variable. 2. Run the `Get-VEXFolder` cmdlet with the `$mailbox` variable. Provide the `Recurse` parameter to get parent folders with subfolders. ::: ::: example ### Example 2. Getting Subfolders of Specific Folder [For Veeam Backup & Replication] This example shows how to get subfolders under the `Contacts` parent folder. ``` $session = Get-VBRExchangeItemRestoreSession $database = Get-VEXDatabase -Session $session -Name "DB_0754907780.edb" $mailbox = Get-VEXMailbox -Database $database -Name "Sales" $parent = Get-VEXFolder -Mailbox $mailbox -Name "Contacts" Get-VEXFolder -Parent $parent ``` Perform the following steps: 1. Get the mailbox: 1. Run the [`Get-VBRExchangeItemRestoreSession`](get-vbrexchangeitemrestoresession.md) cmdlet. Save the result to the `$session` variable. 2. Run the [`Get-VEXDatabase`](get-vexdatabase.md) cmdlet. Set the `$session` variable as the `Session` parameter value. Specify the `Name` parameter value. Save the result to the `$database` variable. 3. Run the [`Get-VEXMailbox`](get-vexmailbox.md) cmdlet. Set the `$database` variable as the `Database` parameter value. Specify the `Name` parameter value. Save the result to the `$mailbox` variable. 2. Run the `Get-VEXFolder` cmdlet. Set the `$mailbox` variable as the `Mailbox` parameter value. Specify the `Name` parameter value. Save the result to the `$parent` variable. 3. Run the `Get-VEXFolder` cmdlet. Set the `$parent` variable as the `Parent` parameter value. ::: ::: example ### Example 3. Getting Folders with Subfolders from Mailbox [For Veeam Backup for Microsoft 365] This example shows how to get all folders with subfolders from the `Sales` mailbox. ``` $session = Get-VBOExchangeItemRestoreSession $database = Get-VEXDatabase -Session $session[0] $mailbox = Get-VEXMailbox -Database $database[0] -Name "Sales" Get-VEXFolder -Mailbox $mailbox -Recurse ``` Perform the following steps: 1. Get the mailbox: 1. Run the [`Get-VBOExchangeItemRestoreSession`](get-vboexchangeitemrestoresession.md) cmdlet. Save the result to the `$session` variable. 2. Run the [`Get-VEXDatabase`](get-vexdatabase.md) cmdlet. Set the `$session` variable as `Session` parameter value and select the necessary restore session. In this example, it is the first restore session in the array. Save the result to the `$database` variable. 3. Run the [`Get-VEXMailbox`](get-vexmailbox.md) cmdlet. Set the `$database` variable as the `Database` parameter value and select the necessary database. In this example, it is the first database in the array. Specify the `Name` parameter value. Save the result to the `$mailbox` variable. 2. Run the `Get-VEXFolder` cmdlet. Set the `$mailbox` variable as the `Mailbox` parameter value. Provide the `Recurse` parameter to get parent folders with subfolders. ::: ::: example ### Example 4. Getting Subfolders of Specific Folder [For Veeam Backup for Microsoft 365] This example shows how to get subfolders under the `Contacts` parent folder. ``` $session = Get-VBOExchangeItemRestoreSession $database = Get-VEXDatabase -Session $session -Name "support3backup*" $mailbox = Get-VEXMailbox -Database $database -Name "Sales" $parent = Get-VEXFolder -Mailbox $mailbox -Name "Contacts" Get-VEXFolder -Parent $parent ``` Perform the following steps: 1. Get the mailbox: 1. Run the [`Get-VBOExchangeItemRestoreSession`](get-vboexchangeitemrestoresession.md) cmdlet. Save the result to the `$session` variable. 2. Run the [`Get-VEXDatabase`](get-vexdatabase.md) cmdlet. Set the `$session` variable as `Session` parameter value. Specify the Name parameter value. Use the * wildcard character to substitute the timestamp. Save the result to the `$database` variable. 3. Run the [`Get-VEXMailbox`](get-vexmailbox.md) cmdlet. Set the `$database` variable as the `Database` parameter value. Specify the `Name` parameter value. Save the result to the `$mailbox` variable. 2. Run the `Get-VEXFolder` cmdlet. Set the `$mailbox` variable as the `Mailbox` parameter value. Specify the `Name` parameter value. Save the result to the `$parent` variable. 3. Run the `Get-VEXFolder` cmdlet. Set the `$parent` variable as the `Parent` parameter value. ::: ## Related Commands - [`Get-VBOExchangeItemRestoreSession`](get-vboexchangeitemrestoresession.md) - [`Get-VBRExchangeItemRestoreSession`](get-vbrexchangeitemrestoresession.md) - [`Get-VEXDatabase`](get-vexdatabase.md) - [`Get-VEXMailbox`](get-vexmailbox.md)