Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My goal is to use winrm to connect to a remote machine and then run a robocopy command on this remote machine that results into copying files from a remote shared drive on the network into this machine but the problem is that robocopy reports "Access Denied" to the remote share folder.

My suspicion is that winrm is running as network services and shared folder reject access to it. BTW, the shared folder access is eveyone but I think network services still can not access the shared folder. My assumption is that winrm run script things under network services. Is that correct?

I tried changing the winrm service to run under admin account but I can not restart the winrm service as I gives the following error

Windows could not start the Windows Windows Remote Management (WS-Management)
on local computer.
Error 1079: The account specified for this service is different from the
from the account specified for other services running in the same process.

How can I solve this?

NOTE: I have to use winrm because I am using opscode knife tool for remote connectivity and they only support winrm.

Is it possible to impersonate robocopy right on command line passed to winrm?

share|improve this question

migrated from stackoverflow.com Dec 20 '12 at 16:48

This question came from our site for professional and enthusiast programmers.

    
When you authenticate, is the user you log in as marked as an admin on that machine? –  horatio Dec 20 '12 at 18:14
    
yes, it is the admin account on that machine –  iCode Dec 20 '12 at 21:16

1 Answer 1

Try PSExec; along with a command to execute, you can specify the credentials with which to log on, so you can run your robocopy command as whatever user you need to.

share|improve this answer
    
please see my note –  iCode Dec 20 '12 at 21:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.