Overview
Scheduled tasks are a reliable and common way of deploying software in any scale from a few machines to hundreds. It is included with all versions of Windows and requires no special installation or programming. There are several ways to create a scheduled task. In this post, we will be looking at scheduling a task using Batch scripting to deploy RightSight service and MeetUp firmware with just a few command line arguments.
Command Line schtasks
For Batch scripting, we will use a text file containing all the room names. One IP, netbios or fqdn room per line. You can generate this list from AD or any other method. There are two ways to then execute the scheduled tasks, on demand or at a specific time. Remember that schedule tasks are based on the time of the local machine. You can find more details on using schtasks at:https://docs.microsoft.com/windows/desktop/taskschd/schtasks
Preparation Steps
- The remote machine(s) must have the inbound firewall rule “Remote Scheduled Tasks Management (RPC)” enabled (allowed)
- The computer is on the domain (if not look at the documentation for the /U and /P parameters and insert that after the %%A below)
- Your account has the required permission to create a scheduled task (Power User at least)
- A file share containing the execution batch script and the installer file for example \\server\share\fwupdater
- Download the Logitech Software and Firmware, this is the MeetUp Firmware Upgrade from: https://support.logi.com/hc/articles/360024844233-Downloads-MeetUp-ConferenceCam
- The Batch script install-rightsight.cmd that contains the following two lines:
- %temp%\fwupdate\FWUpdateMeetup.exe /rs-%1=1 /S
- %CommonProgramFiles(x86)%\LogiShrd\LogiFirmwareUpdateTool-MeetUp\FWUpdateMeetUp.exe -silentUpdate -ForceUpdate
- The account running the script has access to the file share or the computer name (though this will require a larger level of work preparing the shared directory)
- The account in the scheduled task has access to run the installer (domain user)
Process
- Build the scheduled task XML template
- Deploy the template to the list of machines
- At the scheduled time the task will copy the files from the shared location to the %temp%\fwupdate directory of the user account configured in the scheduled task
- The task will then run the installer %temp%\fwupdate\install-rightsight.cmd [dynamic|ocs|off]
Build the Scheduled task Template
Because this process requires two actions, which the schtasks tool does not support, a template will need to be created, then exported. This is a basic scheduled task with the following settings- Name: Install RightSight and Update MeetUp firmware
- Trigger: One time
- Select the date and time you want to run. Remember that this is the local date and time of the computer running the task
- Action: Start a program
- Program: xcopy
- Arguments: \\server\share\fwupdate\*.* %temp%\fwupdate\ (note the trailing \)
- Check the box to open the properties
- Change the username to the account above
- Check the box Run whether user is logged on or not
- Under actions add new
- Program: %temp%\fwupdate\install-rightsight.cmd
- Arguments: one of the following
- Dynamic: (will automatically reframe throughout the session)
- OCS: On-call start (will only reframe at the beginning of the session)
- Off
- Once the task has been completed, select it and in actions choose export and save the file as install-rightsight.xml to your local machine
Deploy the template
The following script will deploy the template to all the machines in the roomsystems-scheduled.txt file. If you save this into a batch file use the %% if you are running this directly from a command line using just %- for /F %%A in (c:\scripts\roomsystems-scheduled.txt) do schtasks /create /s %%A /RP P@ssword! /TN "Install RIghtSight and Update MeetUp firmware" /XML <pathto> install-rightsight.xml
- Because the Password is not exported you will need to reset it as part of the creation, as well as the task name.
Manual Scheduled task
The process for deploying the manual is the same process, except for changes in the scheduled task template and the import file.- Edit (or create) the scheduled task
- Delete the trigger
- Save the changes and export.
Run the scheduled task manually
- for /F %%A in (c:\scripts\roomsystems-scheduled.txt) do schtasks /run /s %%A /TN "Install RIghtSight and Update MeetUp firmware"
Scheduled task History
Scheduled tasks rely on Event Viewer for history. In some cases, this may be disabled by default. To enable this from a remote computer requires the following- The inbound firewall rule needs to be enabled: Remote Event Log Management (RPC)
- Run the following command
- wevtutil set-log Microsoft-Windows-TaskScheduler/Operational /enabled:true /r:<computername>
- If the user running the above command does not have appropriate access, you can add the /p:<password> and /u:<username options
- In a batch script, the command would look like the following
- for /F %%A in (c:\scripts\roomsystems-scheduled.txt) do wevtutil set-log Microsoft-Windows-TaskScheduler/Operational /enabled:true /r:%%A
Frequently Asked Questions
There are no products available for this section
There are no Downloads for this Product
There are no Downloads for this Version.
Show All Downloads