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.