Validate proper userPrincipalName

  • Thread starter Thread starter STeve
  • Start date Start date
S

STeve

Hi guys,

I was wondering if you guys had written any sample code (ie. regular
expressions) which would validate the userPrincipalName or
sAMAccountName used in Active Directory. Are there any invalid
characters (@,#,|,<, etc) or any invalid formats (a....) which cannot
be used within an Active Directory userPrincipalName or
sAMAccountName.

For example,
valid userPrincipalName: john.smith
invalid userPrincipalName: john.

valid userPrincipalName: a*@
invalid userPrincipalName: a*

Any help is appreciated.

Thanks in advance,
Steve
 
Back
Top