Short Description
Returns mailbox items.
Syntax
This cmdlet provides 3 parameter sets.
- For getting mailbox items from a mailbox database:
Get-VEXItem -Database <VEXDatabase[]> [-Query <string>] [<CommonParameters>] |
- For getting mailbox items from a mailbox:
Get-VEXItem -Mailbox <VEXMailbox> [-Query <string>] [<CommonParameters>] |
- For getting mailbox items from a folder:
Get-VEXItem -Folder <VEXFolder> [-Query <string>] [-Recurse] [<CommonParameters>] |
Detailed Description
This cmdlet returns mailbox items. You can search the folder, mailbox or the whole mailbox database to get the needed item.
Parameters
Parameter | Description | Required | Position | Accept | Accept |
Database | Specifies a mailbox database. The cmdlet will return items from this database. | True | Named | True (ByValue) | False |
Mailbox | Specifies a mailbox. The cmdlet will return items from this mailbox. | True | Named | True (ByValue) | False |
Folder | Specifies a mailbox folder. The cmdlet will return items from this folder. | True | Named | True (ByValue) | False |
Query | Allows to use keywords for mailbox item search. The cmdlet will return items that match the search query from the specified folder, database or mailbox. | False | Named | False | True |
Recurse | Indicates that the cmdlet will return items from all subfolders of the specified parent folder. | False | Named | False | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.
Example 1
This example shows how to get mailbox items with names containing "support" from the mailbox database.
You will need to perform the following steps:
- Get the mailbox database and save it to the $database variable:
- Run Get-VBOExchangeItemRestoreSession to get the active restore session. Save the result to the $session variable.
- Run Get-VEXDatabase with the $session variable to get the mailbox database. Save the result to the $database variable.
- Run Get-VEXitem with the $database variable and Query parameter to get items with names containing a specified keyword.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> Get-VEXItem -Database $database -Query "support" |
Example 2
This example shows how to get mailbox items from the mailbox with the name "north.sales".
You will need to perform the following steps:
- Get the mailbox with the name "north.sales" and save it to the $salesmailbox variable:
- Run Get-VBOExchangeItemRestoreSession to get the active restore session. Save the result to the $session variable.
- Run Get-VEXDatabase with the $session variable to get the mailbox database. Save the result to the $database variable.
- Run Get-VEXMailbox with the $database variable and Name parameter. Save the result to the $salesmailbox variable.
- Run Get-VEXitem with the $salesmailbox variable to get items from the "north.sales" mailbox.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> $salesmailbox = Get-VEXMailbox -Database $database -Name "sales" PS C:\PS> Get-VEXItem -Mailbox $salesmailbox |
Example 3
This example shows how to get items from the mailbox folder with the name "Contacts".
You will need to perform the following steps:
- Get the folder with the name "Contacts" and save it to the $contacts variable:
- Run Get-VBOExchangeItemRestoreSession to get the active restore session. Save the result to the $session variable.
- Run Get-VEXDatabase with the $session variable to get the mailbox database. Save the result to the $database variable.
- Run Get-VEXMailbox with the $database variable and Name parameter to get the specific mailbox from the mailbox database. Save the result to the $mailbox variable.
- Run Get-VEXFolder with the $mailbox variable and Name parameter to get the specific folder from the mailbox. Save the result to the $contacts variable.
- Run Get-VEXitem with the $contacts variable to get items from the "Contacts" folder. Use Recurse parameter to get items from the "Contacts" folder and its subfolders.
PS C:\PS> $session = Get-VBOExchangeItemRestoreSession PS C:\PS> $database = Get-VEXDatabase -Session $session PS C:\PS> $mailbox = Get-VEXMailbox -Database $database -Name "sales" PS C:\PS> $contacts = Get-VEXFolder -Mailbox $mailbox PS C:\PS> Get-VEXItem -Folder $contacts -Recurse |
Related Commands
Get-VBOExchangeItemRestoreSession