I have a machine in a domain 'HOME' and a machine in a DMZ which is not able
to communicate with the 'HOME' domain, and thus has it's own local users and
groups.
I'm writing a .NET assembly which will copy files from the machine in the
domain to the machine in the DMZ. When mapping a drive in Explorer I use the
credentials of the DMZ machine: NLIIS405\copyuser, password: copyuser. This
proves that the connection is available.
The problem is the file.copy in the assembly. I always get an access denied
because I should copy the file using the DMZ machine credentials.
Is there a way to copy files from the domain machine to the DMZ machine
using a DMZ machine login? I suspect it has to do with impersonation, but
don't know if the above is possible.
Does someone has experience with connecting to a network share from a server
which is not connected to a domain?

Signature
Michel Smit
Atos Origin Nederland BV
Laura T - 25 Jul 2006 09:40 GMT
It is possible. You could also grant permissions for an user of your domain.
Otherwise you could do a WNetAddConnection2/3 to "logon" on the DMZ machine
(in effect you simulate a net use), copy the file and then delete the
connection.
WNetAddConnection3(Form1.Handle,MapDriveStruct,"copyuser","NLIIS405\copyuser",CONNECT_INTERACTIVE);
File.Copy(...)
WNetCancelConnection2(...)
Docs for WNetXXX APIs are here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/windo
ws_networking_functions.asp
>I have a machine in a domain 'HOME' and a machine in a DMZ which is not
>able
[quoted text clipped - 20 lines]
> server
> which is not connected to a domain?