Link to home
Create AccountLog in
Avatar of Bryon H
Bryon HFlag for United States of America

asked on

exchange 2010, command to search-remove certain messages

hi there

i'm trying to get this process to work:

get-mailbox | export-mailbox -targetmailbox thetarget -targetfolder thefolder -subjectkeywords "some words here" -senderkeywords someuseraddress -deletecontent -maxthreads 10

however, i can't get export-mailbox to be recognized:
The term 'export-mailbox' is not recognized as the name of a cmdlet, function, script file, or operable program. 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:15
+ export-mailbox <<<<
    + CategoryInfo          : ObjectNotFound: (export-mailbox:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


i am logged in as a user who is a domain admin
outlook 2010 x64 is installed on the exchange server
i have the "mailbox import export" role assigned to my username

i have read these links:

http://www.msexchange.org/articles_tutorials/exchange-server-2010/management-administration/exporting-importing-mailboxes-exchange-server-2010.html

http://www.simple-talk.com/sysadmin/exchange/goodbye-exchange-exmerge,-hello-export-mailbox/

https://www.experts-exchange.com/questions/26227355/How-to-search-all-users-mail-boxes-and-delete-based-on-criteria.html

they all eventually say the same thing...  install outlook x64 on the mail server, make sure you have that role, and it should work...

what am i missing - what can i double-check?

SOLUTION
Avatar of Viral Rathod
Viral Rathod
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Bryon H

ASKER

oh i guess i missed those release notes :/

so would my command work like this then?

get-mailbox | new-mailboxexportrequest -targetmailbox thetarget -targetfolder thefolder -subjectkeywords "some words here" -senderkeywords someuseraddress -deletecontent -maxthreads 10
Avatar of Bryon H

ASKER

ok so i see there's some big syntax changes...

logically, the above should be able to be taken care of by this:

get-mailbox | new-mailboxexportrequest -includefolders Inbox -contentfilter {Subject -eq 'SUBJECT HERE'} -deletecontent -filepath "\\server\c$\pstdump"

but, that sends an error for every user saying that pipelining isn't supported

basically, i used to be able to run the command referenced in my question to remove a specific email from all users inboxes, but i need the new equivalent way of doing that :)

when someone calls me and panics that they sent an email to the entire company and spelled something wrong, i'm supposed to be able to rip that out super fast
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Bryon H

ASKER

thanks -
viralrathod made me aware of the command changes but was more along the lines of exporting mailboxes
lucid8 had it on the head, that was exactly what i needed
Happy to assist
Thanks for the Point ,Have a nice day.