Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

local user name disallowed chars

currently if I try to add local user "jim,bob" to a Windows 7 system, as expected, the following error dialog is shown displaying all the illegal chars for a user name. Is there a quick .net method to call which returns the same chars? E.g.

Path.GetInvalidPathChars();

returns all the invalid path chars. Is there a similar method out there for user names?

enter image description here

like image 208
Jeb Avatar asked Jan 04 '12 18:01

Jeb


1 Answers

Path.GetInvalidFileNameChars() - ?

User Name Policies from http://technet.microsoft.com/en-us/library/cc722458.aspx

A key policy you'll need to set is the naming scheme for accounts. In Windows NT, user names must follow these rules:

Local user names must be unique on a workstation.

Global user names must be unique throughout a domain.

User names must be no more than 20 characters in length.

User names cannot contain certain characters. Invalid characters include:

" / \ [ ] : ; | = , + * ? < >

User names can contain all other special characters, including spaces, periods, dashes, and underscores. But it's generally not a good idea to use spaces in account names. On some non-Windows NT systems, such as UNIX, spaces aren't valid in user names and the user may have difficulty accessing these systems.

like image 143
Leon Avatar answered Oct 21 '22 19:10

Leon