Login to Domain

I am developing an application that needs to run in a computer that is not part of the domain but is included in the network. I need to somehow replicate the functionality of the "connect in " dialog box of Windows wherein a user can enter a username and password that can be authenticated by the machine he wants to connect to. Is this possible Can anyone give me something to research on... Thanks.

Answer this question

Login to Domain

  • KathiW

    maybe my post is not in the right place but since i'm developing this application under C#, i just posted it here... i tried every possible providers and logon type but i failed using LogonUser(), if i can just have other alternatives to get the user access token of that specific user in that domain, then i can scrap the idea of using the LogonUser(), but unluckily i don't have any options.. what do you guys think that cause the LogonUser to fail if i am in the machine that is not part of the domain... thanks...


  • SkiesOfBordom

    a follow up question... my "machine" that is not part of the domain is running under Windows XP and the machine i'm connecting to is running under Windows 2000.. i know impersonation on Win2k to work, i should set SE_TCB_NAME priviledge in the Win2k machine to the user who is trying to impersonate... now if this is my scenario do i need to add the user in the WinXP machine to the Win2k machine so i can successfuly do impersonation


  • t nguyen

    actually, i already have tried impersonation using LogonUser API but the problem is when i the machine i'm using is not part of the domain, LogonUser return a zero value of a user token. i don't want to conclude that impersonation only works in machine that are part of the domain. by the way i'm using LOGON32_LOGON_INTERACTIVE and the provider is DEFAULT...

    i'm kinda lost... thanks...

  • FerroFreak

    Hi,

    You can first design a simple form with Windows Forms and build a Logon Box which takes those details. Then you would call Logon User Win32 API to logon as the details provided. Then you can use the code which accesses the other machine using impersonation.

    For details on LogonUser from C#, see this thread:

    http://forums.microsoft.com/msdn/ShowPost.aspx PostID=13473

    Regards,

    Vikram



  • lbordea


    no answer yet... just want to confirm if the LogonUser() only works in users and machines in the same domain.... thanks a lot...

  • Login to Domain