title: Using filter to find email addresses matching a domain
body: <p>I'm trying to find email addresses in O365 Exchange that matches a particular domain using PowerShell.</p>
  
  <p>If I use:</p>
  
  <pre><code>Get-Recipient -ResultSize unlimited -filter '(PrimarySMTPAddress -like "*smith*")' | fl primarysmtpaddress
  </code></pre>
  
  <p>I get all the addresses that have the string</p>
  
  <p>If I use:</p>
  
  <pre><code>Get-Recipient -ResultSize unlimited -filter '(PrimarySMTPAddress -like "*@domain*")' | fl primarysmtpaddress
  </code></pre>
  
  <p>I get no results.</p>
  
  <p>It looks like nothing is matched after the @.  </p>
  
  <p>I want to use <code>-filter</code> rather than a where statement because it is so much faster.</p>