I'm running samba 4.17.12 on Debian Bullseye configured as Active Directory Domain Name Server. I've implemented several other GPO policies without any problem, but now I tried to do a Scheduled Task via a GPO. Its purpose is simple, to force a group of wWndows10 computers to automatically reboot every evening. (Run c:\windows\system32\shutdown.exe with argument "/r" at 11:00PM, for example)
Setting up the scheduled task in the GPO editor went smoothly. The first problem occurred when i ran "gpupdate /force" on one of the client computers: I got an error "group policy 0x80070003 The system cannot find the file", which I eventually tracked to the fact that samba (or the GPO editor) had not created a "Scheduled Tasks" folder in SYSVOL/mydoman.tld/Polices/{blahblah}/Machine/Preferences/. After I created the folder by hand (from linux) and changed permissions (from linux), running "gpupdate /force" on the client was successful and a ScheduledTasks.xml was created in SYSVOL . Also, "gpresult /H report.html" does not produce errors. (gpresult does notice when I make changes to the Scheduled Task, so it clearly is reading the file)
BUT: the scheduled task never executes on client computers, and does not show up in the Task Scheduler app, nor does it appear in SCHTASKS from the windows command shell, on the client computer. Without any errors I'm completely stumped how to debug this further.