# Run deligated scheduled task on remote server via PS without admin rights

**URL:** <https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642>\
**Category:** PowerShell Help\
**Created:** [November 3, 2017, 5:57am UTC](https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642 "2017-11-03T05:57:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sponsen](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sponsen](https://forums.powershell.org/u/sponsen)\
**Post date:** [November 3, 2017, 5:57am UTC](https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642/1 "2017-11-03T05:57:05Z")

</div>

Hi,

I’m trying to allow a non-admin user to run a scheduled task via PS, without giving out more permissions than required.  
So far, i have given the user Read+Execute rights on the task file located in C:\Windows\System32\Tasks. This allowed the user to see and run the task in the GUI and Start-ScheduledTask -TaskName “taskname” locally via RDP. But when i try to do the same PS command via invoke command from a workstation, it fails.

How can i get this working without delegating unnecessary permissions?

---

<div class="post-metadata">

**Author:** ![sanchez](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sanchez](https://forums.powershell.org/u/sanchez)\
**Post date:** [November 3, 2017, 6:29am UTC](https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642/2 "2017-11-03T06:29:03Z")

</div>

[https://4sysops.com/archives/powershell-remoting-without-administrator-rights/](https://4sysops.com/archives/powershell-remoting-without-administrator-rights/)

---

<div class="post-metadata">

**Author:** ![sponsen](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sponsen](https://forums.powershell.org/u/sponsen)\
**Post date:** [November 3, 2017, 7:34am UTC](https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642/3 "2017-11-03T07:34:42Z")

</div>

I forgot to mention that i had added the user to the Remote Management Users group, and testet that Invoke-Command servername {hostname} works.

---

<div class="post-metadata">

**Author:** ![sponsen](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sponsen](https://forums.powershell.org/u/sponsen)\
**Post date:** [November 3, 2017, 7:55am UTC](https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642/4 "2017-11-03T07:55:02Z")

</div>

I have had some progress in my testing. My solution works for me, but i’d like to know why it behaves like this…

```
# This works.
Invoke-Command -ComputerName servername -ScriptBlock {schtasks /run /tn "taskname"}

# This doesn't.
Invoke-Command -ComputerName servername -ScriptBlock {Start-ScheduledTask -TaskName "taskname"}
```

---

<div class="post-metadata">

**Author:** ![sanchez](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sanchez](https://forums.powershell.org/u/sanchez)\
**Post date:** [November 3, 2017, 8:26am UTC](https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642/5 "2017-11-03T08:26:26Z")

</div>

What error message do you get?

---

<div class="post-metadata">

**Author:** ![sponsen](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sponsen](https://forums.powershell.org/u/sponsen)\
**Post date:** [November 3, 2017, 8:33am UTC](https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642/6 "2017-11-03T08:33:37Z")

</div>

```
Cannot connect to CIM server. Access denied
    + CategoryInfo : ResourceUnavailable: (PS_ScheduledTask:String) [Start-ScheduledTask], CimJobException
    + FullyQualifiedErrorId : CimJob_BrokenCimSession,Start-ScheduledTask
    + PSComputerName : servername
```

Let me add that the user is a part of the “Protected Users” group.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:37pm UTC](https://forums.powershell.org/t/run-deligated-scheduled-task-on-remote-server-via-ps-without-admin-rights/9642/7 "2024-05-16T20:37:16Z")

</div>


