This may prove to be useful in cases where a user, or group, may need to run a script on a remote computer that requires admin privileges. Therefore, limiting the need for added permissions.
Make sure that this task will be able to run whether the user is logged on or not.
Next, we need to make sure that the Windows directory that holds all your tasks has the right permissions for the group or user you want to all to start it.
Navigate to your Windows directory, right-click and select proprieties on the Tasks folder. Go to the Security tab, click Edit and add the group or user that you want to allow to remotely start your task.
Click OK and give them Full control.
After that, write a batch file to remotely start this task.
Replace the TaskName with your task name and the ComputerName to the remote computer’s name that has your scheduled task.
powershell.exe -command Set-ExecutionPolicy RemoteSigned -Force powershell.exe -command "invoke-command {schtasks /run /tn 'TaskName'} -computer ComputerName"
Finally, Deploy the batch file over to the user or group that you’ve added to Permissions for Tasks
Working in IT for more than 15 years now, I’ve ran into and solved problems that are very specific to network and system administration.
I have implemented my expertise in designing, developing and executing technical solutions that have passed the test of time, managing simple and complex systems, and administrating networks.