Hi Stephen,
Did you try this already in the newsgroup
microsoft.public.dotnet.security
Maybe you can find your answer there
Cor
> I am trying to copy a file to a network drive. I can do it on the
> domain controller/web server but not from a client. Here is the code:
>
> Dim impersonationContext As
> System.Security.Principal.WindowsImpersonationContext
> Dim currentWindowsIdentity As
> System.Security.Principal.WindowsIdentity
> currentWindowsIdentity = CType(User.Identity,
> System.Security.Principal.WindowsIdentity)
> impersonationContext = currentWindowsIdentity.Impersonate()
> 'response.write(User.Identity.Name)
> 'response.end
> dim Temp as string="TestFile"
> File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &
> ".doc")
>
> impersonationContext.Undo()
>
> With or without impersonation I am getting errors, but it works fine,
> as I said, on the domain controller. How do I specify a specific
> individual when executing this code?
|