Re: Issue with GetUserNameExA
- From: "Mark Yudkin" <myudkinATcompuserveDOTcom@xxxxxxxxxxxxxx>
- Date: Fri, 18 Nov 2005 09:09:59 +0100
After installing the W2K3 administrative tools on your XP client, use the
Users and Computers tool to review the content. You can find the tools
package on any W2K3 CD, or you can download them from the Microsoft web
site.
"Marc" <Marc@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:05E1C245-FCB6-4F5C-BBF0-4B4836BBADD5@xxxxxxxxxxxxxxxx
>I am of course relying upon our Network Admin when he tells me that it is
> not. I am not very well versed in that area to make the determination for
> myself. Do you have any ideas as to where I may look to verify whether or
> not it has been setup correctly?
>
> Thanks.
>
> Marc.
>
> "Mark Yudkin" wrote:
>
>> Have you verified that the W2K3 domain's Active Directory hasn't been
>> misconfigured?
>>
>> "Marc" <Marc@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:467265B5-7123-4501-8552-6B6ED4827C1A@xxxxxxxxxxxxxxxx
>> >I have a function (see below) that retrieves the currently logged in
>> >Windows
>> > User account (Domain\Username). When executing against a Windows 2000
>> > Domain, it returns exactly what I would expect...Domain\Username.
>> > However,
>> > when I execute the code against/within a Windows Server 2003 Domain,
>> > what
>> > I
>> > have been getting back is Domain\UserFirstName, not the actual Windows
>> > Username. Any ideas on what I may be doing incorrect? Or is there a
>> > change
>> > in the Windows Server 2003 APIs that does not appear to be documented
>> > anywhere?
>> >
>> > Thank you in advance for your assistance.
>> >
>> > Marc.
>> >
>> > Private Declare Function GetUserNameAPI Lib "secur32.dll" Alias
>> > "GetUserNameExA" (ByVal NameFormat As Long, ByVal lpNameBuffer As
>> > String,
>> > nSize As Long) As Long
>> >
>> > Public Function GetWindowsUser() As String
>> > Dim sBuffer As String
>> > Dim lLen As Long
>> >
>> > sBuffer = Space(255 + 1)
>> > lLen = Len(sBuffer)
>> >
>> > If CBool(GetUserNameAPI(2, sBuffer, lLen)) Then
>> > GetWindowsUser = Trim$(Left$(sBuffer, lLen - 1))
>> > Else
>> > GetWindowsUser = ""
>> > End If
>> > End Function
>> >
>>
>>
>>
.
- Follow-Ups:
- Re: Issue with GetUserNameExA
- From: NickHK
- Re: Issue with GetUserNameExA
- References:
- Re: Issue with GetUserNameExA
- From: Mark Yudkin
- Re: Issue with GetUserNameExA
- Prev by Date: Re: Creating a virtuell rs232-connection?
- Next by Date: RE: Creating a virtuell rs232-connection?
- Previous by thread: Re: Issue with GetUserNameExA
- Next by thread: Re: Issue with GetUserNameExA
- Index(es):
Relevant Pages
|