• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Create scheduled task on a W10 with snapins

Scheduled Pinned Locked Moved Solved
FOG Problems
3
4
508
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P
    processor
    last edited by processor Nov 24, 2022, 8:47 AM Nov 24, 2022, 2:46 PM

    Hi,

    This is my configuration :

    Server :

    • Ubuntu 18.04
    • list itemFOG Server 1.5.7

    Clients :

    • 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 :

    Batch (shutdown.bat):

    @echo off
    IF EXIST "C:\Users\AB\Desktop\Extinction_Auto" (
    	echo "exist"
    	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.

    Proc.

    L 1 Reply Last reply Nov 24, 2022, 7:49 PM Reply Quote 0
    • L
      luilly23 @processor
      last edited by Nov 24, 2022, 7:49 PM

      @processor you can do bat with -> /ru “System”
      schtasks /create /sc daily /tn “MYTASK-DAILY-20PM” /TR “shutdown /p /s” /ST 20:00 /ru “System” > C:\Users\AB\Desktop\done.txt

      P 1 Reply Last reply Nov 25, 2022, 8:04 AM Reply Quote 1
      • S
        Sebastian Roth Moderator
        last edited by Nov 24, 2022, 4:22 PM

        @processor said in Create scheduled task on a W10 with snapins:

        Both scripts works without any issue if I run them directly on a client.

        The fog-client runs as SYSTEM user (as a service) and you cannot compare this to manually running scripts.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        1 Reply Last reply Reply Quote 0
        • L
          luilly23 @processor
          last edited by Nov 24, 2022, 7:49 PM

          @processor you can do bat with -> /ru “System”
          schtasks /create /sc daily /tn “MYTASK-DAILY-20PM” /TR “shutdown /p /s” /ST 20:00 /ru “System” > C:\Users\AB\Desktop\done.txt

          P 1 Reply Last reply Nov 25, 2022, 8:04 AM Reply Quote 1
          • P
            processor @luilly23
            last edited by Nov 25, 2022, 8:04 AM

            @luilly23 said in Create scheduled task on a W10 with snapins:

            @processor you can do bat with -> /ru “System”
            schtasks /create /sc daily /tn “MYTASK-DAILY-20PM” /TR “shutdown /p /s” /ST 20:00 /ru “System” > C:\Users\AB\Desktop\done.txt

            Thanks, that’s what I was searching for !

            I did not found in the forum how to make it as valid answer, any idea?

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            1 / 1
            • First post
              2/4
              Last post

            156

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project