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?