Case difference between NT and XP when using GetUserName API

G

Guest

As part of a migration from NT to XP for 5000+ PCs, I have come across an issue where the case returned by XP for the logged on user is different to under NT.
If you use the username property of the wscript.network object or use the GetUsername API the case is returned as the samAccountName with the case preserved on NT but on XP the username is returned exactly as it was entered at the login screen.
That is to say, if the user logs into XP by typing in USERx for the username then WSH and the API call will return USERx whereas NT returns UserX(as it appears in the samAccountName).
This is causing issues for some applications which are attempting to authenticate to Unix hosts where the username is case-sensitive.
Can anybody:
1) Explain why this occurs
2) Provide a solution that will make these calls return the samAccountName under XP
 
R

Roger Abell

After you have the loginname, use such as Wmi to obtain
the samName property of the user object. Why is it so?
Who knows, but the samName is the downlevel name, not
the primary name in uplevel Windows versions and as far
as I know NetBIOS is not case sensitive so I would guess
these differences were not considered worth the overhead.

--
Roger Abell
Microsoft MVP (Windows Server System: Security)
MCSE (W2k3,W2k,Nt4) MCDBA
Chris Goffin said:
As part of a migration from NT to XP for 5000+ PCs, I have come across an
issue where the case returned by XP for the logged on user is different to
under NT.
If you use the username property of the wscript.network object or use the
GetUsername API the case is returned as the samAccountName with the case
preserved on NT but on XP the username is returned exactly as it was entered
at the login screen.
That is to say, if the user logs into XP by typing in USERx for the
username then WSH and the API call will return USERx whereas NT returns
UserX(as it appears in the samAccountName).
This is causing issues for some applications which are attempting to
authenticate to Unix hosts where the username is case-sensitive.
 
G

Guest

The problem is that it is not my code that is making the calls, it is third party applications, ie compiled code, and therefore I cannot do the conversion because it would require altering the vendors code. So the question is, is there any configuration we can do before running the application to alter the output of these calls, or do we have to tell the customer that they need to delete the username from the login screen and enter it in the correct case themselves?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top