I’m not really sure if this is possible with Powershell so thought I would ask here first for a quick brainstorm! Essentially I need to search through all mailboxes in a given Exchange looking for specific strings – multiple forms of these strings – lets say in this case – any email containing a set of 6 numbers in any of the following formats:
`xx-xx-xx
xxxxxx
xxx-xxx`
Where x is a number in this case. So if any of these strings are found in the mail, it logs to a text file the mailbox and email/subject it is contained in.
My logic would be as follows:
Search Exchange and loop for every mailbox
Recurse in every mailbox looking for matches for the above criteria
If it finds something - get info about that mail, write to text file
Continue loop
Any ideas!
Thanks
this is for Exchange 2010 from the Exchange Management Shell:
You need to do this for any
[string]you are searching.I think there’s cmdlet also in exchange 2007 to do same thing, but I can swear.