title: Powershell - Search Exchange mailbox and emails
body: <p>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:</p>
  
  <pre><code>`xx-xx-xx
   xxxxxx
   xxx-xxx`
  </code></pre>
  
  <p>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.</p>
  
  <p>My logic would be as follows:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Any ideas!</p>
  
  <p>Thanks</p>