Re: LookupAccountName

From: Yu Chen [MS] (yuchen_at_online.microsoft.com)
Date: 04/27/04


Date: Mon, 26 Apr 2004 22:18:34 -0700

You can use WNetAddConnection2() to make a connection to the server which
you are targeting LookupAccountName(), then call LookupAccountName() to look
up the SID.

-- 
Yu Chen [MS]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Mike" <anonymous@discussions.microsoft.com> wrote in message
news:467601c42bc7$ffbb7ca0$a401280a@phx.gbl...
> Hi All,
> I am trying to use LookupAccountName() to get the SID of
> a domain user.  However, the machine that I call this
> from is not a member of a domain, and the call fails
> with "Access Denied".  Is there any way of obtaining a
> user's SID if I have the username and password if the
> machine making the call is not on a domain?
>
> Thanks in advance,
> Mike
>


Relevant Pages

  • Re: Writing to RunOnce from a Credential Provider
    ... As for the original question, the returned error code indicates that the specified account name was not found. ... The recommended way is to call LookupAccountName with NULL buffers to get the required buffer sizes, ... I've decided that the best way for the CP to pass this information to the custom software is via the RunOnce registry key, so that the custom app will start as soon as the desktop loads and can have the information passed in on the command line. ... So, I figure that I need to look up the SID of the user I'm logging in as, then write to the RunOnce of the appropriate subkey under HKEY_USERS. ...
    (microsoft.public.platformsdk.security)
  • Re: Writing to RunOnce from a Credential Provider
    ... once I have the buffer sizes, ... As for the original question, the returned error code indicates that the specified account name was not found. ... - The SID is a variable-length structure - its exact length depends on the number of subauthority RIDs. ... The recommended way is to call LookupAccountName with NULL buffers to get the required buffer sizes, ...
    (microsoft.public.platformsdk.security)
  • Re: System Identifier
    ... Actually, I meant LookupAccountName, which, given an account name returns ... back the SID. ... flakey and Windows can't get necessary info, ... So after we get the SID for the account, we hack on it as mentioned in the ...
    (microsoft.public.win32.programmer.kernel)
  • get logged in domain name
    ... I currently use LookupAccountName to get the domain nameof the user that is ... I just found an issue if there is a local account with the same ... Public Function GetLogonDomainuser(sUserName As String) As String ... Dim bUserSid(255) As Byte ' This will contain your SID. ...
    (microsoft.public.vb.winapi)
  • Re: get logged in domain name
    ... > Thanks for your help Karl. ... >>> I currently use LookupAccountName to get the domain nameof the user ... >>> Public Function GetLogonDomainuser(sUserName As String) As String ... ' This will contain your SID. ...
    (microsoft.public.vb.winapi)