Could not start PSEXESVC service on [MachineName]: Access is denied

9

2

I'm trying to use PsExec to start a process on a remote machine. I posted this question on SO, but I realized it's probably better suited here. I also have spent a few hours trying to figure this out, and haven't really gotten anywhere.

Here is one of the questions I've looked at, as well as a couple of forum posts. The second link is the one I'm interested in. One of the posters suggests using net use to see if the credentials I'm trying to use with PsExec work for that, and they do. When I try to run PsExec, I'm running it from an administrator instance of cmd, and I use this command:

PsExec.exe \\[MachineName] -u [domain]\[user] -p [password] cmd

This is unsuccessful, and returns:

Could not start PSEXESVC service on [MachineName]:
Access is denied.

However, when I issued this command in the same instance of cmd:

net use \\[MachineName] /user:[domain]\[user]

I was prompted for a password, to which I entered [password], and it returned:

The command completed successfully.

This seems like all the relevant information to me, and it also seemed that way in the other posts I looked at, but I'm not sure what else to add. I've spent a couple hours trying to figure this out, with no success. I'd appreciate any help, and let me know if you need any other information from me.

Sean Cogan

Posted 2015-01-15T21:23:25.643

Reputation: 193

1try running the command prompt as the user you are connecting as, by holding shift + Right click on the CMD launcher, and selecting run as differant user. I've generally had bad luck trying to specify the user in the psexec command in domain situations. then you can use psexec \\machine cmd. Also consider using -i if the user is logged in interactively. – Frank Thomas – 2015-01-15T21:25:50.803

Can I still do this if the account is a local account on the target machine? – Sean Cogan – 2015-01-15T21:29:14.593

Answers

11

Use the command in this way instead:

PsExec.exe -u [domain]\[username] -p [password] \\[Machine Name] cmd

For some reason, PsExec tries to start "PsExeSVC" on the remote computer using your local credentials instead of the domain credentials specified hence the "access is denied" error.

On the other hand, when you specify the credentials first, it works as expected.

Peter Avamale

Posted 2015-01-15T21:23:25.643

Reputation: 126

1does not work either - is there something I should check on the target machine? – mbx – 2017-03-31T11:20:43.327

@mbx me too, Perter's observation is correct. If I logon as a user with permissions the command works, but no matter where in the line I put the user and password, it fails if the logged on user doesn't have access. I'm trying this on Windows 10 in a domain environment. – Jason – 2018-03-20T19:00:21.433

0

I'm using PsExec v2.2 and the problem was solved when I used psexec64.

https://community.spiceworks.com/topic/1977162-psexec-32-bit-on-64-bit-host-no-longer-working

arkhos

Posted 2015-01-15T21:23:25.643

Reputation: 1

Please consider expanding your answer. Thanks! – studiohack – 2020-01-03T16:21:14.267