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 ?