Windows Domain Username Regex
Command for this is given below.
Windows domain username regex. The samaccountname value must be unique in the domain. If instead of domain you see workgroup your computer is not a member of any domain. The down level logon name format is used to specify a domain and a user account in that domain for example domain username. I was curious what is my computer name and fall under which domain group.
The domain name should not start or end with hyphen e g. A character literal the backslash. For any issues related to domain network please post your query in technet forums. The question borders on active directory and frankly any username combination can be setup.
Wednesday january 14 2009 9 43 am. I am validation a log in control and i would like to use a regular expression that test to make sure that a domain name is not supplied with the user name. The samaccountname attribute of a computer object is the netbios name of the computer with a trailing dollar sign appended. Therefore username would be fine however domainname username is not.
Sharepoint uses the domain username notation. So i did a check on my laptop btw i am running windows xp professional. Systeminfo findstr b c domain we can find the logged in user s domain by using the environment variable userdomain. When i am browsing my network share folder i can see a lot of computer workgroup name and domain.
Our computer name and domain were set by the system admin in the company. Besides flagging the object as a computer which has class user it also helps ensure uniqueness. Can any one help me with regular expression of valid windows user names and domain name. You will need to examine how the names are setup on your system and tailor the regex to it.
The following table summarizes the parts of a down level logon name. Echo userdomain note that the value in userdomain may not be the. The domain name should be a z a z 0 9 and hyphen the domain name should between 1 and 63 characters long. Last tld must be at least two characters and a maximum of 6 characters.
The check is just for a string of the correct format since it takes a little while to process the script on a large sharepoint install i want to check the syntax at least is correct otherwise it takes 10 30 seconds to find out you made a typo.