2

I have a follow-up question to this.

I have a task folder RPA with two tasks as follows:

enter image description here

I created these two tasks myself using the Task Scheduler UI (as in above image). My trouble is I am now unable to see SPSBatch using SchTasks.exe:

enter image description here

I am user BEETHOVEN\kingk and have the same Full access rights to both tasks in the \Windows\System32\Tasks\RPA folder:

enter image description here

Besides file permissions on the files in the Tasks folder, what else is controlling access to tasks?

Old Geezer
  • 355
  • 7
  • 21
  • I've extended those answers with a solution and script: https://serverfault.com/a/1046122/471857 – unNamed Dec 14 '20 at 15:37

2 Answers2

2

The security descriptor is stored in the registry, similar to what is done for services.

Key: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\RPA
Value: SD

Probably also a value for each task.

Greg Askew
  • 34,339
  • 3
  • 52
  • 81
1

@OldGeezer @GregAskew thanks to your link to SD I was able to translate the binary SD to readable property with following Powershell:

$PathToTask = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree\Microsoft"
$SDBin =  ( (get-itemProperty $PathToTask).sd )

ConvertFrom-SddlString ([wmiclass]"Win32_SecurityDescriptorHelper").BinarySDToSDDL($SDBin).SDDL

With the above you should be able to read what are the current ACLs, and if you work your way through methods from Win32_SecurityDescriptorHelper , you should be able to create your own ACL and replace it, giving you access to the task. I haven't tested that though

AlexPawlak
  • 126
  • 4