+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
Enterprise Software Thread, Tidy up exchange 2010 journaling mailbox in Technical; Originally Posted by markcuk pretty sure the export-mailbox command was taken out exchange 2010 I was trying to export mailboxes ...
  1. #16

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,933
    Thank Post
    886
    Thanked 1,692 Times in 1,471 Posts
    Blog Entries
    12
    Rep Power
    446
    Quote Originally Posted by markcuk View Post
    pretty sure the export-mailbox command was taken out exchange 2010 I was trying to export mailboxes last week. You have to use the following command New-MailboxExportRequest: Exchange 2010 Help
    This is it. Using this cmdlet how do i clear the mailbox after the export please?

  2. #17
    ascott2's Avatar
    Join Date
    Nov 2007
    Posts
    181
    Thank Post
    18
    Thanked 37 Times in 29 Posts
    Rep Power
    20
    export-Mailbox has a -DeleteContent parameter which I think, deletes all the content after the export. It has been a while since I ran this, so double check before running.

  3. #18
    markcuk's Avatar
    Join Date
    Sep 2005
    Posts
    586
    Thank Post
    29
    Thanked 60 Times in 55 Posts
    Rep Power
    38

  4. #19

    Join Date
    Sep 2011
    Location
    Cambridgeshire
    Posts
    182
    Thank Post
    2
    Thanked 14 Times in 13 Posts
    Rep Power
    14
    I am trying to build this script in 2010 SP2, so have managed to adjust the command to use the new New-MailboxExportRequest but they have deprecated the -deletecontent command and moved it seemingly to the Search-Mailbox command. Which is all well and good for single operations.

    How do I mix this up into a script, as I assume if i call the first command and then the second, it wont wait for the export and just delete it all!

    Any help appreciated, I just want to export our journal mailbox out to pst once a month, and then clear down the mailbox. I thought about doing one command one day and then the other the next, but I'm always going to have some tween mails that happen between each command.

    This is doing my head in!

    Thanks

    James

  5. #20

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,933
    Thank Post
    886
    Thanked 1,692 Times in 1,471 Posts
    Blog Entries
    12
    Rep Power
    446
    Quote Originally Posted by CAWJames View Post
    I am trying to build this script in 2010 SP2, so have managed to adjust the command to use the new New-MailboxExportRequest but they have deprecated the -deletecontent command and moved it seemingly to the Search-Mailbox command. Which is all well and good for single operations.

    How do I mix this up into a script, as I assume if i call the first command and then the second, it wont wait for the export and just delete it all!

    Any help appreciated, I just want to export our journal mailbox out to pst once a month, and then clear down the mailbox. I thought about doing one command one day and then the other the next, but I'm always going to have some tween mails that happen between each command.

    This is doing my head in!

    Thanks

    James
    @CAWJames Im sure we can help, please can you post the code for the script. If you dont mind i might "borrow" it

  6. #21

    Join Date
    Sep 2011
    Location
    Cambridgeshire
    Posts
    182
    Thank Post
    2
    Thanked 14 Times in 13 Posts
    Rep Power
    14
    After some long hours running around the more 'codier' parts of the net, I have a solution:


    $dtoday = get-date -format "dd-MM-yyyy"
    New-Item \\srv-id-009\MonitorArchive$\$dtoday -type directory -Force
    New-MailboxExportRequest -Mailbox Email_journal_user -FilePath \\srv-id-009\MonitorArchive$\$dtoday\$dtoday.pst

    while ((Get-MailboxExportRequest -Mailbox Email_journal_user | Where {$_.Status -eq "Queued" -or $_.Status -eq "InProgress"}))
    {
    sleep 60
    }

    Get-MailboxExportRequest -Mailbox Email_journal_user | Remove-MailboxExportRequest -Confirm:$false
    Get-Mailbox -ID Email_journal_user | Search-Mailbox -SearchQuery 'subject:"*"' -deletecontent -force

    Both parts with a while loop in the middle. It still left about 17 emails in the box afterwards, but they are probably just things archived after the fact and the odd bit not covered by -SearchQuery 'subject:"*"'.

    Bold bits are the bits to change as they point to my system.

    Thanks, and hope this helps others,

    James

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Exchange 2010, exporting mailboxes to .pst.
    By sch in forum Enterprise Software
    Replies: 14
    Last Post: 4th March 2013, 06:20 PM
  2. Setting up Exchange 2010 SSL for OWA, ActiveSync etc
    By MrWu in forum Enterprise Software
    Replies: 1
    Last Post: 15th January 2012, 08:20 PM
  3. Replies: 2
    Last Post: 12th August 2010, 12:15 PM
  4. Microsoft Exchange 2010 (New Setup - 2000 mailbox)
    By RobFuller in forum Internet Related/Filtering/Firewall
    Replies: 6
    Last Post: 13th March 2010, 02:35 PM
  5. Replies: 1
    Last Post: 4th September 2007, 07:49 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •