I am trying to execute task on PcRemote from PcLocal and I am getting the ERROR: Access is denied.
This is the command that I am using: SCHTASKS /Run /S PcRemote /U PcRemote\AdminRemote /P password /TN "TaskToRun"
I execute the command from PcLocal loged in as AdminLocal that is part of Administrators group. On PcRemote AdminRemote is also part of Administrators group. Computer are not part of a domain but they are in the same LAN. I can use Remote Desktop to access PcRemote login in as AdminRemote. I have enabled Remote Scheduled Tasks Management in Windows Firewall settings. Tried with firewall off too.
Task executes C:\CMD\test.cmd that just has the command mkdir C:\CMD\Dir. It is configured to run wheter user is loggedon or not, and to run with highest privileges. It runs as user PcRemote\AdminRemote.
Trying to connect to PcRemote through Task Scheduler as suggested here https://www.action1.com/how-to-different-ways-to-create-scheduled-task-remotely/ gives the same error. You do not have permission to access this computer.
Is command that I am using not correct or I need do something else? Is this even possible if computers are not part of a Domain and running just Windows 10?