Windows Username maximum length

crauscher picture crauscher · Apr 1, 2009 · Viewed 59k times · Source

What is the maximum length of a Windows domain + username? That is, what is the legal limit for a domain/username in Windows?

Answer

JohnTESlade picture JohnTESlade · Jan 28, 2010

The maximum lengths are hash defined in lmcons.h. DNLEN is the maximum domain length and UNLEN is the maximum user name length.

In the version of this file I have on my XP machine (installed as part of Visual Studio 8), DNLEN = 15 and UNLEN = 256.