Impersonation failing at LogonUse to access remote server

Posted by bless_ishita-10797 under ASP.NET on 8/18/2011 | Points: 10 | Views : 1396 | Status : [Member] | Replies : 0
I am trying to access a remote fileshare having different domain.For which I have written an Impersonate class having WindowsIdentity(NewToken).Impersonate(); . The code fails at "LogonUser(userName, domain, password, 2, 0, ref zero" giving permission denied error. But when I impersonate in web.config ,it works fine.I am able to access fileshare. Somewhere I read that I need to give computerName as parameter in the place of Domain . I tried that but failed.
Can you please help me understand what I need to do to achieve this ?


(No response found.)

Login to post response