question

HassanKhan-0147 avatar image
0 Votes"
HassanKhan-0147 asked JustinEmlay-1133 answered

(PsExec): Logon failure: the user has not been granted the requested logon type at this computer.

Hi,

I am using PsExec v2.32 version

C:\PSTools>psexec \\end-user-pc -u Administrator cmd.exe

PsExec v2.32 - Execute processes remotely
Copyright (C) 2001-2021 Mark Russinovich
Sysinternals - www.sysinternals.com

Password:

PsExec could not start cmd.exe on end-user-pc:
Logon failure: the user has not been granted the requested logon type at this computer.

I would appreciate if any concern person provide assistance in this issue.
Thank you..

windows-sysinternals-pstools
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

foxmsft avatar image
0 Votes"
foxmsft answered JustinEmlay-1133 commented

The -i flag is also required to run the remote command with redirected IO for PsExec v2.3+.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

While -i will allow the process to run, the OP is trying to run a command as Admin and -i will not give them that.

I remote run a CPU miner that runs faster with admin privileges but will run slower without it. At some point mid 2021 an updated pushed out that killed local admin logins for PSExec. Doesn't matter what version you run, 2.20 to current. That was on Windows LTSC 1809. Now that we're using LTSC 2021, same problem. There is no way to gain local admin privileges using PSExec. No way that I've been able to figure out.

PsExec.exe \\XXXXXX -u XXXXXX\Administrator -p YYYYYY "C:\Program Files......."

Logon failure: the user has not been granted the requested logon type at this computer. (yes, they have, policy shows admin group which is default)

PsExec.exe -i \\XXXXXX -u XXXXXX\Administrator -p YYYYYY "C:\Program Files......."

It runs but...
Failed to set MSR for the CPU. Admin/root privileges required.

Worked fine before the updates and worked fine before 21H2.

0 Votes 0 ·
CostiNechifor-9435 avatar image
0 Votes"
CostiNechifor-9435 answered CostiNechifor-9435 published

Had the same problem the -i flag did not work.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JustinEmlay-1133 avatar image
1 Vote"
JustinEmlay-1133 answered

And of course 2 seconds later I find a solution....

When logging in as Admin you also need the -h flag if you want full admin privileges.

So from my previous example:

PsExec.exe -i -h \\XXXXXX -u XXXXXX\Administrator -p YYYYYY "C:\Program Files......."

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.