Restore-RMEMessage
From PowerGUI Wiki
Restores specific messages.
Contents |
Syntax
Restore-RMEMessage [-SourceMessages] <Object> [[-TargetFolder] <IMapiContainer>] [-DuplicateAction <DuplicateAction>] [<CommonParameters>]
Detailed Description
The Restore-RMEMessage cmdlet restores specific messages.
Related Commands
Parameters
| Name | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|
| SourceMessages | Specifies the messages to be restored. Enter a variable that contains the message objects or type a command or expression that gets the message objects. | true | true (ByValue, ByPropertyName) | |
| TargetFolder | Specifies the target folder to restore the messages to. Enter a variable that contains the target folder object or type a command or expression that gets the target folder object. | false | false | |
| DuplicateAction | Specifies how to handle message duplicates during the restore operation.
This parameter can take one of the following values:
| false | false |
Examples
Example 1
$target = Attach-RMEExchangeMailbox "S2K2000C" "Administrator" | Get-RMEFolder "Restored" C:\PS>Attach-RMEExchangeDB "C:\Data\Edb\EdbSearchTest\EdbSearchTest.edb" | Get-RMEFolder "John Doe\Inbox" | Get-RMEMessage | Restore-RMEMessage -TargetFolder $target
In the first line of this example, the Attach-RMEExchangeMailbox cmdlet connects to the Administrator mailbox hosted on the Exchange Server named S2K2000C. The mailbox object is then piped to the Get-RMEFolder cmdlet that retrieves the Restored folder from the mailbox. The Restored folder object is then saved in the $target variable.
In the second line of this example, a connection is established to the EdbSearchTest.edb mailbox store database, and all messages are retrieved from the Inbox folder in the John Doe mailbox. The retrieved messages are then restored to the folder saved in the $target variable.
Example 2
$target = Attach-RMEExchangeMailbox -ServerName "S2K2000C" -MailboxDn "Administrator" | Get-RMEFolder "Restored" C:\PS>Attach-RMEExchangeDB "C:\Data\Edb\EdbSearchTest\EdbSearchTest.edb" | Get-RMEFolder "John Doe\Inbox" | Get-RMEMessage | Restore-RMEMessage -TargetFolder $target -DuplicateAction Overwrite
In the first line of this example, the Attach-RMEExchangeMailbox cmdlet connects to the Administrator mailbox hosted on the Exchange Server named S2K2000C. The mailbox object is then piped to the Get-RMEFolder cmdlet that retrieves the Restored folder from the mailbox. The Restored folder object is then saved in the $target variable.
In the second line of this example, a connection is established to the EdbSearchTest.edb mailbox store database, and all messages are retrieved from the Inbox folder in the John Doe mailbox. The retrieved messages are then restored to the folder saved in the $target variable. The messages being restored overwrite all their duplicates found in the target folder.
Example 3
$target = Attach-RMEExchangePublicFolders -ServerName "S2K2000C" -MailboxDn "Administrator" | Get-RMEFolder "Restored" C:\PS>Attach-RMEExchangeDB "C:\Data\Edb\EdbSearchTest\EdbSearchTest.edb" | Get-RMEFolder "John Doe\Inbox" | Get-RMEMessage | Restore-RMEMessage -TargetFolder $target -DuplicateAction OverwriteIfNewer
In the first line of this example, the Attach-RMEExchangePublicFolders cmdlet uses the access account for the Administrator mailbox to connect to the public folder hierarchy of the Exchange organization to which belongs the Exchange Server named S2K2000C. The public folder hierarchy object is then piped to the Get-RMEFolder cmdlet that retrieves the Restored folder from the public folder hierarchy. The Restored folder object is then saved in the $target variable.
In the second line of this example, a connection is established to the EdbSearchTest.edb mailbox store database, and all messages are retrieved from the Inbox folder in the John Doe mailbox. The retrieved messages are then restored to the folder saved in the $target variable. If the messages being restored are newer than their duplicates in the target folder, the duplicates are overwritten.
