Answered by:
How to get specific email from Exchange 2007 by script?

Question
-
Hello all!
I have a following situation: I have one user with mailbox in Exchange 2007. There is some script that each several minutes sends one mail with some subject name to this use. I need to create a script that will look for this subject name in inbox of this user and after finds it will delete it.
How can i create script, that reads emails of this user from Exchange 2007 and not from Outlook?
Thanks!
Saturday, April 14, 2012 5:12 PM
Answers
-
Hi pavlenych,
When you want to remove specific email from Exchange 2007, you can use this command to do that:
Export-mailbox -identity usermailbox -subjectkeywords "subject name" -IncludeFolders "\Inbox" -DeleteContent
You can know more details from this document:
Removing specific messages from your Exchange Server
http://blogs.technet.com/b/exchange/archive/2010/10/27/removing-specific-messages-from-your-exchange-server.aspxThanks,
Evan
Evan Liu
TechNet Community Support
- Proposed as answer by Mike Crowley Thursday, April 19, 2012 4:12 PM
- Marked as answer by Evan LiuModerator Sunday, April 22, 2012 7:29 AM
Monday, April 16, 2012 7:43 AMModerator
All replies
-
The short answer is that you will probably want to use Exchange Web Services for that. I recommend that you post your question in the Development forum, http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads, but before doing that you might want to start doing research yourself on how to program with Web Services.
Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
- Edited by Ed CrowleyMVP Saturday, April 14, 2012 5:45 PM
Saturday, April 14, 2012 5:44 PM -
Ed Crowley
Thanks a lot!
Sunday, April 15, 2012 6:04 AM -
You're welcome. Please feel free to mark my post as the answer and/or helpful as appropriate.
Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
Monday, April 16, 2012 4:52 AM -
Hi pavlenych,
When you want to remove specific email from Exchange 2007, you can use this command to do that:
Export-mailbox -identity usermailbox -subjectkeywords "subject name" -IncludeFolders "\Inbox" -DeleteContent
You can know more details from this document:
Removing specific messages from your Exchange Server
http://blogs.technet.com/b/exchange/archive/2010/10/27/removing-specific-messages-from-your-exchange-server.aspxThanks,
Evan
Evan Liu
TechNet Community Support
- Proposed as answer by Mike Crowley Thursday, April 19, 2012 4:12 PM
- Marked as answer by Evan LiuModerator Sunday, April 22, 2012 7:29 AM
Monday, April 16, 2012 7:43 AMModerator