Re: Case difference between NT and XP when using GetUserName API

From: Roger Abell (mvpNOSpam_at_asu.edu)
Date: 07/05/04


Date: Sun, 4 Jul 2004 21:24:18 -0700

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" <ChrisGoffin@discussions.microsoft.com> wrote in message
news:9273ACD2-6375-4229-ADAE-A45E48023590@microsoft.com...
> 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
>


Relevant Pages

  • Re: Case difference between NT and XP when using GetUserName API
    ... "Roger Abell" wrote: ... > the samName property of the user object. ... > preserved on NT but on XP the username is returned exactly as it was entered ...
    (microsoft.public.windowsxp.security_admin)
  • Question about ADSI username change
    ... I use the following code to change the username ... oIADSUser.Put "sAMAccountName", "BBB" ... this user object I still need to use LDAP://CN=AAA. ... Is it a bug or ... ...
    (microsoft.public.windows.server.active_directory)
  • Problem about ADSI username change
    ... I use the following code to change the username ... oIADSUser.Put "sAMAccountName", "BBB" ... this user object I still need to use LDAP://CN=AAA. ... Is it a bug or ... ...
    (microsoft.public.windows.server.active_directory)
  • Problem about ADSI user name change
    ... I use the following code to change the username ... oIADSUser.Put "sAMAccountName", "BBB" ... this user object I still need to use LDAP://CN=AAA. ... Is it a bug or ... ...
    (microsoft.public.windows.server.active_directory)
  • Re: Win95 to Server2003
    ... Do I want to ask what the hardware specs are!?!?! ... I changed my password policy to not enforce anything, set my user object ... domain password you supplied is not correct, or access to your logon ... 'The username cannot be found'. ...
    (microsoft.public.windows.server.active_directory)