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
    Posts

  • verbalh
    Member
    #156773

    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 (http://serverfault.com/questions/117241/using-export-mailbox-without-including-subfolders). 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.

Download this eBook!

External Sharing and Guest User Access in Microsoft 365 and Teams

his eBook will dive into policy considerations you need to make when creating and managing guest user access to your Teams network, as well as the different layers of guest access and the common challenges that accompany a more complicated Microsoft 365 infrastructure. The eBook will also outline some of the major decision points across four general-purpose guest access policy scenarios for how an organization can set this up with standard licensing.

Download Now

Sponsored By