3

Is it possible to remotely install a Windows system serive using PsExec? The files are already on the remote system; I am trying to use

psexec \\remote-host-name -u myusername -p mypassword PathToExecutable

where PathToExecutable is the path to some executable which is intended to install the service; somehow the service is not installed due to unclear reasons. Is remote installation via PsExec possible at all?

Codor
  • 17,447
  • 9
  • 29
  • 56
  • 1
    Installers often want UI interaction, something PsExec can't give them since it will run things in the service session (which has no access to the UI). Even if the installer is silent and doesn't have this issue, it's possible that it's failing on something else you don't have remotely (like permissions, or a profile). Take a look at PowerShell remoting; it's a bit more cumbersome to set up but also more convenient. Failing that, you'd have to use something like `procmon` to figure out what, exactly, the installer is failing on, but this can be very tedious. – Jeroen Mostert Oct 14 '14 at 09:24
  • 2
    But before you try all that, try `-h` first to see if the problem isn't simply that it's not running as an administrator... :-) – Jeroen Mostert Oct 14 '14 at 09:25
  • Well, it doesn't have to be be beautiful; in fact I want to programmatically install a service for continuous integration - just see if the service can be installed, "use" it and remotely deinstall it. – Codor Oct 14 '14 at 09:26
  • @JeroenMostert Well, that was it in fact! Thanks a lot! – Codor Oct 14 '14 at 09:29
  • @JeroenMostert I suggest you reformulate your comment to an answer. – Codor Apr 30 '15 at 18:14

1 Answers1

3

In my case, the issue was fixed by using the command line parameter:

-h         If the target system is Vista or higher, has the process
           run with the account's elevated token, if available.

to run the command with administrator permissions.

StackzOfZtuff
  • 2,534
  • 1
  • 28
  • 25
Codor
  • 17,447
  • 9
  • 29
  • 56