Get-VEXFolder

In this article

    Short Description

    Returns folders added to Microsoft Exchange mailboxes.

    Applies to: Veeam Backup & Replication, Veeam Backup for Microsoft Office 365

    Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License

    Syntax

    This cmdlet provides parameter sets that allow you to:

    • Get the first level of folders from the mailbox.

    Get-VEXFolder [-Mailbox] <VEXMailbox> [[-Name] <string>] [-Recurse]  [<CommonParameters>]

    • Get subfolders under the specified parent folder from the mailbox.

    Get-VEXFolder [-Parent] <VEXFolder> [[-Name] <string>] [-Recurse]  [<CommonParameters>]

    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

    Accept Wildcard Characters

    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.

    True

    0

    True (ByValue)

    False

    Name

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

    String

    False

    1

    False

    True

    Parent

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

    Accepts the VEXFolder type.

    True

    0

    True (ByValue)

    False

    Recurse

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

    SwitchParameter

    False

    Named

    False

    False

    <CommonParameters>

    This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About Common Parameters section of Microsoft Docs.

    Output Object

    The cmdlet returns the VEXFolder object that contains folders added to Microsoft Exchange mailboxes.

    Examples

    Get-VEXFolderExample 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 cmdlet. Save the result to the $session variable.
    2. Run the Get-VEXDatabase 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 cmdlet. Set the $database variable as the Database parameter value. Specify the Name parameter value. Save the result to the $mailbox variable.
    1. Run the Get-VEXFolder cmdlet with the $mailbox variable. Use the Recurse parameter to get parent folders with subfolders.

    Get-VEXFolderExample 2. Getting Subfolders Under 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 cmdlet. Save the result to the $session variable.
    2. Run the Get-VEXDatabase 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 cmdlet. Set the $database variable as the Database parameter value. Specify the Name parameter value. Save the result to the $mailbox variable.
    1. 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.
    2. Run the Get-VEXFolder cmdlet. Set the $parent variable as the Parent parameter value.

    Get-VEXFolderExample 3 Getting all Folders and Subfolders from Mailbox [For Veeam Backup for Microsoft Office 365]

    This example shows how to get all folders with subfolders from the Sales mailbox.

    $session = Get-VBOExchangeItemRestoreSession

    $database = Get-VEXDatabase -Session $session -Name support3backup.onmicrosoft.com

    $mailbox = Get-VEXMailbox -Database $database -Name "Sales"

    Get-VEXFolder -Mailbox $mailbox -Recurse

    Perform the following steps:

    1. Get the mailbox:
    1. Run the Get-VBOExchangeItemRestoreSession cmdlet. Save the result to the $session variable.
    2. Run the Get-VEXDatabase cmdlet. Set the $session variable as Session parameter value. Specify the Name parameter value. Save the result to the $database variable.
    3. Run the Get-VEXMailbox cmdlet. Set the $database variable as the Database parameter value. Specify the Name parameter value. Save the result to the $mailbox variable.
    1. Run the Get-VEXFolder cmdlet. Set the $mailbox variable as the Mailbox parameter value. Provide the Recurse variable.

    Get-VEXFolderExample 4. Getting Subfolders Under Parent Folder [For Veeam Backup for Microsoft Office 365]

    This example shows how to get subfolders under the Contacts parent folder.

    $session = Get-VBOExchangeItemRestoreSession

    $database = Get-VEXDatabase -Session $session -Name support3backup.onmicrosoft.com

    $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 cmdlet. Save the result to the $session variable.
    2. Run the Get-VEXDatabase cmdlet. Set the $session variable as Session parameter value. Specify the Name parameter value. Save the result to the $database variable.
    3. Run the Get-VEXMailbox cmdlet. Set the $database variable as the Database parameter value. Specify the Name parameter value. Save the result to the $mailbox variable.
    1. 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.
    2. Run the Get-VEXFolder cmdlet. Set the $parent variable as the Parent parameter value.

    Related Commands