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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With