I have to read the user log in my app even with run as and the name created in domain in windows server 2012have 23 char, i used :
Environment.UserName
new Sys
This is a hard limit on the samAccountName property:
"You can't modify the length of the user's samAccountName, it is a defined value within the schema and is set to 20."
See: this page for source
Maybe you could try the UserPrincipalname
System.DirectoryServices.AccountManagement.UserPrincipal.Current().UserPrincipalName
you need to add a reference to the AccountManagement
Namespace