title: What is the easiest way to validate a UPN and a NT login name?
body: <p>We allow our users to enter Active Directory account information using either an NT account name (domain\account) or a UPN (account@email,xxx).  I would like to write some code to validate the account in active directory before allowing the user to move on.  Note, we are not validating a password, just the account name.</p>
  
  <p>I can use <code>UserPrincipal.FindByIdentity</code>, however, this expects only a user name.  </p>
  
  <p>Can I validate the account name in either format using .NET?  Or am I relegated to parsing out out the domain from the account name to validate both parts of the user input?  The later would be a bit messy, woudln't it?</p>