This is my configuration :
- Ubuntu 18.04
- list itemFOG Server 1.5.7
- Windows 10 20H2
- Fog Client 0.11.16
I’m trying to create scheduled tasks on Windows using Fog Snapins.
Unfortunalely nothing worked.
It tried these both scripts :
IF EXIST "C:\Users\AB\Desktop\Extinction_Auto" (
COPY /Y NUL C:\Users\AB\Desktop\done.txt
schtasks /create /sc daily /tn "MYTASK-DAILY-20PM" /TR "shutdown /p /s" /ST 20:00 > C:\Users\AB\Desktop\done.txt
) else (
COPY /Y NUL C:\Users\AB\Desktop\notdone.txt
This Powershell script also (shutdown.ps1):
$trigger = New-ScheduledTaskTrigger -Daily -At 8pm
$action = New-ScheduledTaskAction -Execute 'shutdown /p /s'
Register-ScheduledTask -Trigger $trigger -Action $action -TaskPath "\" -TaskName "SHUT-DAILY-20PM" > C:\shutdown.txt
None of both worked, using snapin dedicated templates or not.
Both scripts works without any issue if I run them directly on a client.
I found another solution which is to add them in the startup folder of a client, but then I have modify the registery of the client to allow autoadminlogin to apply them.
But modyfiying the registery did not work either, even with a message telling “it’s done”, in fact it’s not. I tried to use PsExec to run commands but it did not worked with the snapins.
I’ll take any help or suggestion to apply these scheduled task or a change to the registery.
Many thank in advance.