PsExec is not working on Windows 10 Pro due to "Access denied" error

10,055

IIRC the admin$ share uses SMB1/CIFS which 1709 or 1803 automatically disabled because MS considers SMB1 not secure enough. (If you're using a samba server and your windows client cannot access network shares anymore after upgrading to one of these versions, the answer below should also work for you)

It has to be manually reactivated through "turn windows features on or off" full name : SMB 1.0/CIFS File Sharing Support. Be aware that this feature contains both client and server, be sure to expand the feature's tree to check if you correctly install the one you need (server for psexec, client for network shares)

Share:
10,055
AV FMX
Author by

AV FMX

Updated on June 05, 2022

Comments

  • AV FMX
    AV FMX almost 2 years

    GOAL

    Remotely access from a machine to another, using psexec, in order to start/stop a net service.

    CONFIGURATION

    • Windows 10 Pro on both machines
    • PsExec v2.2

    ISSUE

    Couldn't access MACHINE_IP:
    Access denied.
    

    PREMISE

    • from now on, I'll refer to those machines as A and B
    • A is able to ping B
    • the accounts I used to accomplish that task are both administrators

    WHAT I'VE TRIED

    The first attempt was quite simple; so, from A, I ran:

    psexec \\B_IP -u B_ADMIN_NAME -p B_ADMIN_PWD net stop SERVICE_NAME
    

    but, as a result, I got the "Access denied" error. Searching for the issue, I've found a lot of possible solutions but, unfortunately, noone worked for me. Here's what I tryied:

    • disable Windows Defender on A and B
    • disable User Account Control on A and B
    • uncheck "Use Sharing Wizard" from "Folder Options > View > Advanced Settings" on A and B
    • add the new DWORD (32-bit) LocalAccountTokenFilterPolicy (set to 1) inside "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" on A and B
    • save credetials before execute psexec using cmdkey.exe /add:B_IP /user:B_IP\B_ADMIN_NAME /pass:B_ADMIN_PWD
    • try to get admin permissions on remote PC before using psexec with net use \\B_IP\ipc$ /user:B_ADMIN_NAME B_ADMIN_PWD
    • try to run psexec as administrator using runas /user:B_ADMIN_NAME "psexec -e -h -s -u B_ADMIN_NAME -p B_ADMIN_PWD \\B_IP cmd /C net stop SERVICE_NAME"

    Another strange thing is that A cannot access to B via filesharing. To be precise, it can access to \\B_IP but not to \\B_IP\C$ nor \\B_IP\ADMIN$.

    I think those two issues (access denied with psexec and filesharing) are somehow related but, as I said, noone of the previous solutions worked for me.

    Any other ideas would be very appreciated.

    Thanks.

  • Basil Peace
    Basil Peace over 2 years
    IIUC, SMB features should be installed vice versa. Since psexec connects to ADMIN$, it is a client