title: Search for certain UPN suffix
body: <p>How do I search AD users by UPN suffix in AD? The users are under <code>Uofguelph/SEC213/users</code> OU.</p>
  
  <p>Some users have <code>@sec213.com</code> suffix and some have <code>@home.sec213.com</code> suffix. I need to search for users who only have <code>@sec213.com</code> suffix.</p>
  
  <p>I have the following two code snippets. Code 1 gets all accounts in the users OU. Code 2 gets all accounts ending with that suffix. I couldn't get it to combine the two.</p>
  
  <p>Code 1:</p>
  
  
  
  <pre class="lang-psh prettyprint-override"><code>Get-ADUser -Filter {UserPrincipalName -Like "@sec213.com"} | Ft Name, userprincipalname
  </code></pre>
  
  <p>Code 2:</p>
  
  <pre class="lang-psh prettyprint-override"><code>Get-ADUser cmdlet
  Clear-Host
  Get-ADUser -LDAPfilter '(name=)' `
      -SearchBase 'OU=users,OU=sec213,ou=uofguelph,DC=corp,DC=local,DC=com' |
    Ft name, userprincipalname
  </code></pre>