Re: Copy file to remote PC



<alexia.bee@xxxxxxxxx> wrote in message news:808af84f-c81b-46b8-9c59-7e587412b6fc@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am afraid that file.copy or permission access is good for copying
file manually. it is not the same
if copying file prorammatically.

I saw there is a function called UserLogOm() but it is not good for
RPC in the domain.


Don't know what RPC has to do with this.
You need to run your program in a domain account with appropriate privileges to access the remote share.
In your program all you need to do is specify the UNC path of the remote file, something like this:
File.Copy("localfile", @"\\servername\sharename\dir\dir\file");

If you don't run in a domain account, you will have to create a logon session (LogonUser() ) and impersonate a domain account.
Another viable option is to create a session with the remote server/share using the "net use ..." command line utility.

For instance when you issue following command (from the command line or by code):

net use \\remServer\someShare myDomainPwd /user:myDomain\myDomainAccount

you will be able to copy a local file to the remote share like this:

...
File.Copy("somefile.txt", @"\\remServer\someShare\someremotefile.txt");
....


Willy.

.



Relevant Pages

  • Re: Copy file to remote PC
    ... Don't know what RPC has to do with this. ... You need to run your program in a domain account with appropriate privileges ... In your program all you need to do is specify the UNC path of the remote ... For instance when you issue following command (from the command line or by ...
    (microsoft.public.dotnet.languages.csharp)
  • [UNIX] GNU Mailutils Multiple Vulnerabilities (Buffer Overflows, Format String, DoS)
    ... execute arbitrary code from remote using the GNU Mailutils programs. ... Remote exploitation of a format string vulnerability in the imap4d server ... The vulnerability specifically exists in the handling of the command tag ...
    (Securiteam)
  • RV: remote tape with ontape (dd command) fail after openssh install
    ... I solved the permission denied of root remote command adding remote host to ... The source of problem has to do with the post installation openssh. ...
    (comp.databases.informix)
  • Re: who flags on OSR5
    ... logged in user with command: ... On a box with about 220 users, all but 5 remote in terms of being not within ... Checking a few other smaller boxes shows almost the same thing. ... Sometimes my own ssh session shows up, sometimes nothing at all is retruned ...
    (comp.unix.sco.misc)
  • Re: error messages in mce 2005, why?
    ... The remote is considered optional, since you can order an MCE PC without a tuner. ... Most vendors like Sony, Dell, Compaq consider the remote an option. ... Execute the command regsvr32.exe atl.dll ...
    (microsoft.public.windows.mediacenter)