title: Searching UserPrincipal with partial name
body: <p>Before i start, i want to make it clear that I'm able to do this using the DirectoryServices namespace. I just want to know how to achieve my below question not using DirectoryServices.</p>
  
  <p>What I'm trying to do is use the <a href="http://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.userprincipal(v=vs.110).aspx" rel="nofollow">DirectoryServices.AccountManagement.UserPrincipal</a>  class to partial name search for a user account. The catch is, i would like to get the following properties: EmailAddress, GivenName, MiddleName, SurName, etc.
  Note: All the properties I'm looking for ARE all exposed in UserPrincipal. here is an example using UserPrincipal without partial name search.</p>
  
  <pre><code>        using (UserPrincipal user = UserPrincipal.FindByIdentity(ctx, IdentityType.SamAccountName, userName))
          {
              return user;
          }
  </code></pre>
  
  <p>From the tutorials I've read, i can partial name search using the following code: </p>
  
  <pre><code>        using (UserPrincipal user = new UserPrincipal(ctx))
          {
              user.SamAccountName = String.Format("*{0}*", userName);
  
              using (PrincipalSearcher searcher = new PrincipalSearcher())
              {
                  searcher.QueryFilter = user;
                  return searcher.FindAll();
              }
          }
  </code></pre>
  
  <p>The problem with this is when i iterate through the PrincipalSearcher collection (searcher), it's of the <a href="http://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.principal(v=vs.110).aspx" rel="nofollow">Principal</a>  data type. And the Principal data type doesn't contain any of the properties i mentioned above.</p>
  
  <p>So my question is, how can i use UserPrincipal to partial name search and get the properties that are NOT exposed in the Principal data type? Or is this not possible?</p>