Link to home
Start Free TrialLog in
Avatar of locdang
locdang

asked on

Move a file accross a network in C# using different credentials

Hi all,

I have a windows service that is polling a local folder for a particular criteria of file, when it finds it, it should then move the file to a network share on another computer.

The local machine account (which the service runs under) is not able to access that share, nor can the service be run by another account, it must be run under the local machine account.

I want to be able to specify domain user credentials for the service to be able to move the file to the network share.

Can anyone help?

Thanks,

Xavier.
ASKER CERTIFIED SOLUTION
Avatar of Bob Hoffman
Bob Hoffman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of locdang
locdang

ASKER

HBHoffman,
I am afraid that won't work, the machine the service is running on is not on the same domain as the destination share.

nhenny2009,
As I said in the question I cannot change the account the service runs as, it as to be the local machine account.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of locdang

ASKER

A mapped drive wouldn't work as its a service. It needs to be able to run when no one is logged in.
Sorry, I misunderstood.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i have a question regarding the following statement

>> The local machine account (which the service runs under) is not able to access that share, nor can the service be run by another account, it must be run under the local machine account.

why the service cannot be run under any other domain authenticated account other then local machine account
are there any limitations