WindowsIdentity

Discussion in 'General troubleshooting' started by pongourcom1, Mar 11, 2005.

  1. How can we check WindowsIdentity on client machine using our webfrom? Please help me out.
    Thanks.
     
  2. I think this code is for Windows application. If we use it in a webform it always returnmy Discountasp.net server machine ID: WEB110\aspnet_1280.. What I wish to know is the machine ID the user uses to connect to my web sites. Thanks.
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    I do not think it is possible. Webform application (on the server) do not have access to security information on the client machine.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  4. Thank you for your kind responses. You might be right. I'm now turning to VBScripts for a solution. Do you have any suggestions on this subject?
     
  5. Now Ihave managed toobtain the information I need through a VBScript but I don't know how to migrate it to server side code. Could you please help me out? Thanks.
     
  6. System.Security.Principal.WindowsImpersonationContext userID;
    this.userID = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();








    try that one :)





    Will
     
  7. After adding references to Windows.Form and System.Security I plugged your code into a test web application as follows:


    protected System.Security.Principal.WindowsImpersonationContext userID;


    private void Page_Load(object sender, System.EventArgs e){


    this.userID = ((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();


    }


    ERROR: An anonymous identity cannot perform an impersonation.


    Thank you for your kind response.
     
  8. you need to change the settings for the project in IIS
    you are not using Windows Authentication



    run Microsoft Management Console (MMC)


    Add the IIS Add-In


    Right click on your website project folder


    Goto Directory Security


    Hit the Edit Button


    Make sure that Integrated Windows Authentication is checked.





    I believe this will only work for computers logged into your domain using their Windows Password (Intranet) not Internet users


    I could be wrong =)





    other then that I am not sure.





    Will

    Post Edited (womalley) : 6/1/2005 9:15:11 PM GMT
     
  9. Internet users are my primary targets.


    Thank you for your response.
     

Share This Page