Link to home
Start Free TrialLog in
Avatar of Starquest321
Starquest321

asked on

Export-Mailbox (New Exmerge) In 2010

With Exmerge on my 2003 I used to be able to specify the DATES and period of extraction. How can I do something simlar with the export mailbox command? Is there another tool which is better?
SOLUTION
Avatar of davorin
davorin
Flag of Slovenia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Starquest321
Starquest321

ASKER

How do I get to the GUI ?
Exchange Management Console is the GUI for managing Exchange 2010, but I don't think that you will be able to specify a date range using GUI.
http://www.howexchangeworks.com/2009/06/export-import-in-exchange-2010.html
Somehow I stumbled on this link . . .and now I am confused:

http://technet.microsoft.com/en-us/library/ff607299.aspx

Do I need: New-MailboxExportRequest?
If you have Exchange 2010 then you need to use Export-Mailbox command.
If you use Exchange 2010 SP1, then you need to use New-MailboxExportRequest

That is one of the differences when you install SP1 on Exch 2010.
[PS] C:\Windows\system32>New-MailboxExportRequest -Identity Tom -StartDate "01/01/2008" -EndDate "12/31/2008" -PS
TFolderPath Z:\Tom\2008\cleanup2008.pst


The term 'New-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable progr
am. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:25
+ New-MailboxExportRequest <<<<  -Identity Tom -StartDate "01/01/2008" -EndDate "12/31/2008" -PSTFolderPath Z:\Tom\2008\cleanup2008.pst
    + CategoryInfo          : ObjectNotFound: (New-MailboxExportRequest:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

THis is the error I get
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok - I followed the procedure. . .now the is the command:

New-MailboxExportRequest -Mailbox jdoe -FilePath \\192.168.1.102\Outlook\jdoe\2008\2008cleanup.pst -StartDate "01/01/2008" -EndDate "12/31/2008"

Is there something wrong with the syntax above?


The term 'New-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable progr
am. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The term 'New-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable program

means you didn't follow the instruction in my article, if you are sure you did then logoff, logon and try again
Can you please go to bin directory in your exchange server directory, find exsetup.exe file and check and post product version number of the file?
It should be something like 14.xx.xxxx.xxx
Akhater: I have followed the article and created the security group. When I run the command - maybe the problem is that I am not specifying the new security group "user" to run the command as? How can I check?
Akhater: I just realized something else - the articles does not specify if I should any members to the group. Could that be the problem?
Please add the user you are using to the group, logoff logon and try again
New-MailboxExportRequest -Mailbox jdoe -FilePath \\192.168.1.102\Outlook\jdoe\2008\2008cleanup.pst -StartDate "01/01/2008" -EndDate "12/31/2008"


Also - can you recheck my syntax?
Looks like the log off/on worked -- after adding the user to the group. But now a different problem:


A positional parameter cannot be found that accepts argument '-StartDate'.
    + CategoryInfo          : InvalidArgument: (:) [New-MailboxExportRequest], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,New-MailboxExportRequest
there is no start and end date parameters for New-MailboxExportRequest
O no! The whole point is to extract the mail box based on dates to the pst so you can later refer. . . .that is what exmerge did! And we have user mailboxes according to years/months.....

This is a real problem.. . wow
Found this:

Finally its worth mentioning that the New-MailboxExportRequest cmdlet supports the “-ContentFilter” parameter, which means that you have a rich set of extra filtering options as your disposal when exporting data. You can filter content based on attachments, recipients in TO/CC/BCC field, message body or subject, category, message expiration time, whether or not message has attachment, importance, whther message is flagged or read, message locale, participants, received date/time, policy tag, size and so on (check the Exchange 2010 SP1 help file for details).

For instance, if I only wanted to export messages with “Exchange” or “2010” in the body received before August 1st 2010, I would use this command:

New-MailboxExportRequest -Mailbox HEW -ContentFilter {(body -like "*Exchange*") -and (body -like "*2010*") -and (Received -lt "01/08/2010")} -FilePath \\EX02\PSTFiles\HEW.pst

But how can I specify the range?
I never said you can't filter based on dates but just that there is no startdate and enddate

New-MailboxExportRequest -Mailbox jdoe -FilePath \\192.168.1.102\Outlook\jdoe\2008\2008cleanup.pst -contentfilter {(Received -gt '2011-01-01') -and (Received -lt '2011-09-30')}
Great . . .but the question will it also extract the "Sent" items - not just recieved?
This will extract the whole mailbox not just the received, give it a try
Akhater: Before I do "damage" - I just want to confirm:

New-MailboxExportRequest -Mailbox jdoe -FilePath \\192.168.1.102\Outlook\jdoe\2008\2008cleanup.pst -contentfilter {(Received -gt '2008-01-01') -and (Received -lt '2008-12-31')}

The above will take ALL INBOX items - EMAIL ONLY - sent and recieved in 2008  from jdoe mailbox and put them as a pst file called 2008pstcleanup.pst

Right?
It will not cleanup though, original emails wont be deleted
So no good - how can I add the option to delete the original emails? Also contacts entered in 2008 will not be affected, right?
I would like to integrate the content filter to include selecting ONLY email messages. Would the line item at the bottom be the right way?

-ContentFilter {MessageKind -eq Email}

New-MailboxExportRequest -Mailbox jdoe -FilePath \\192.168.1.102\Outlook\jdoe\2008\2008cleanup.pst -contentfilter {(Received -gt '2008-01-01') -and (Received -lt '2008-12-31')} and
-ContentFilter {MessageKind -eq Email}


Now I am missing the "DELETE" the original so I can shrink mailbox sizes.
Looks like I have to integrate this?
http://social.technet.microsoft.com/Forums/en/exchange2010/thread/6536714e-8640-4b4b-a2d3-574e0d21ffb8

And I got here. .


http://technet.microsoft.com/en-us/library/ff459253.aspx

But .. .

But I don't know how to find the dates conent filter. .  .
there is no delete option in exchange 2010 you will need to do a totally different query using the search mailbox
What is the query for that?
I will open a new question for the delete query . . but to close this one:

Can you tell me how to integrate the Email option?


I would like to integrate the content filter to include selecting ONLY email messages. Would the line item at the bottom be the right way?

-ContentFilter {MessageKind -eq Email}

New-MailboxExportRequest -Mailbox jdoe -FilePath \\192.168.1.102\Outlook\jdoe\2008\2008cleanup.pst -contentfilter {(Received -gt '2008-01-01') -and (Received -lt '2008-12-31')} and
-ContentFilter {MessageKind -eq Email}
[PS] C:\Windows\system32>New-MailboxExportRequest -Mailbox jdoe -FilePath \\192.168.1.102\Outlook\jdoe\2008\2008cleanup.ps
t -contentfilter {(Received -gt '2008-01-01') -and (Received -lt '2008-12-31') -and(MessageKind -eq Email)}
The provided ContentFilter value is invalid. ContentFilter is invalid. Invalid filter syntax. For a description of the
filter parameter syntax see the command help.
"(Received -gt '2008-01-01') -and (Received -lt '2008-12-31') -and(MessageKind -eq Email)" at position 83. --> Invalid
filter syntax. For a description of the filter parameter syntax see the command help.
"(Received -gt '2008-01-01') -and (Received -lt '2008-12-31') -and(MessageKind -eq Email)" at position 83.
    + CategoryInfo          : InvalidArgument: ((Received -gt '...Kind -eq Email):String) [], ContentFilterInvalidPerm
   anentException
    + FullyQualifiedErrorId : 6841DBAC

Looks like my syntax is incorrect. Should I open up another question?
New-MailboxExportRequest -Mailbox jdoe -FilePath \\192.168.1.102\Outlook\jdoe\2008\2008cleanup.pst -contentfilter {(Received -gt '2008-01-01') -and (Received -lt '2008-12-31') -and (MessageKind -eq Email)}

please try this
I get this error:


[PS] C:\Windows\system32>New-MailboxExportRequest -Mailbox Ron -FilePath \\192.168.1.102\Outlook\ron\2008\2008cleanup.ps
t -contentfilter {(Received -gt '2008-01-01') -and (Received -lt '2008-12-31') -and (MessageKind -eq Email)}
The provided ContentFilter value is invalid. ContentFilter is invalid. Invalid filter syntax. For a description of the
filter parameter syntax see the command help.
"(Received -gt '2008-01-01') -and (Received -lt '2008-12-31') -and (MessageKind -eq Email)" at position 84. --> Invalid
 filter syntax. For a description of the filter parameter syntax see the command help.
"(Received -gt '2008-01-01') -and (Received -lt '2008-12-31') -and (MessageKind -eq Email)" at position 84.
    + CategoryInfo          : InvalidArgument: ((Received -gt '...Kind -eq Email):String) [], ContentFilterInvalidPerm
   anentException
    + FullyQualifiedErrorId : 61C308DF
New-MailboxExportRequest -Mailbox Ron -FilePath \\192.168.1.102\Outlook\ron\2008\2008cleanup.pst -contentfilter {(Received -gt '2008-01-01') -and (Received -lt '2008-12-31') -and (MessageKind -eq "Email")}

please
PERFECT . . IT WORKED.
Now how can I run the another command to cleanup the extracted emails from the mailbox?
https://www.experts-exchange.com/questions/27344232/Exchange-2010-Delete.html
i will see if i can help with the other question, if you got your answer on this one please close it
Thanks Akhatar