Exchange 2007 Mailbox Export to PST – Exclude subfolder in Inbox

Home Forums Messaging Software Exchange 2007 / 2010 / 2013 Exchange 2007 Mailbox Export to PST – Exclude subfolder in Inbox

Viewing 1 post (of 1 total)
  • Author
  • Avatar

    I’ve been working on this for hours and have run into just a couple of articles. A user mailbox has a ton duplicate folders under the INBOX that keeps growing. I am looking to completely export the mailbox to PST but ‘exclude’ all of the subfolders under Inbox while still keep everything that is in the Inbox.

    I got this option from the following website ( I have a syntax issue in the method call but don’t know where it is Missing ‘)’ in method call.

    $r = [regex]’/’;

    $exclude = Get-Mailbox -Identity mailtest | Get-MailboxFolderStatistics | where {$_.folderpath -ne “/” -and $_.FolderPath -ne “/Inbox”} | Select-Object FolderPath | Foreach {$_.folderpath.tostring()} | foreach {$r.replace($_”,””,-1)}

    I got the following error message:


    [PS] H:>$r = [regex]’/’;

    [PS] H:>$exclude = Get-Mailbox “mailtest” | Get-MailboxFolderStatistics | where

    {$_.folderpath -ne “/” -and $_.FolderPath -ne “/Inbox”} | Select-Object FolderP

    ath | Foreach {$_.folderpath.tostring()} | foreach {$r.replace($_”,””,-1)}

    Missing ‘)’ in method call.

    At line:1 char:217

    + $exclude = Get-Mailbox “mailtest” | Get-MailboxFolderStatistics | where {$_.f

    olderpath -ne “/” -and $_.FolderPath -ne “/Inbox”} | Select-Object FolderPath |

    Foreach {$_.folderpath.tostring()} | foreach {$r.replace($_ < <<< ”,””,-1)} + CategoryInfo : ParserError: (CloseParenToken:TokenId) [], Paren tContainsErrorRecordException + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall ************************ I decided to run the following command but this is if I am exporting to a ‘target mailbox’. Export-Mailbox -TargetMailbox mailtest -TargetFolder C:MAILTEST -ExcludeFolders “Inbox”,”Delete this Folder” I’d like to just export the mailbox to a PST and ‘exclude’ all of the duplicate subfolders under INBOX. I still need the emails in the INBOX. Then delete and recreate the mailbox. Then I want to ‘import’ the PST into the mailbox. Does anyone have any thoughts on this? Thanks in advance.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.