Skip to main content

Scheduled Tasks - Winget Update All

Purpose

The ultimate objective of this solution is to establish and oversee two scheduled tasks designed to update installed applications utilizing Winget on Windows 10 and 11 machines within the environment.

  • The Winget Update All [System] task executes Winget's upgrade all command upon system boot (after network connection) under the SYSTEM context.
  • The Winget Update All [Logged on User] task initiates Winget's upgrade all command upon user login.

Note: Excluding the client/location/computer will remove both scheduled tasks from the associated endpoint(s).

Associated Content

Script

ContentTypeFunction
Script - Scheduled Task - Create - Winget Update All [Autofix]ScriptCreates the tasks.
Script - Scheduled Task - Delete - Winget Update All [Autofix]ScriptDeletes the tasks.

Internal Monitor

ContentTypeFunction
Internal Monitor - Execute Script - Scheduled Task - Create - Winget Update AllInternal MonitorDetects the Windows 10 and 11 machines where either of the tasks are missing.
Internal Monitor - Execute Script - Scheduled Task - Delete - Winget Update AllInternal MonitorDetects the Windows 10 and 11 machines where either of the tasks are present but are excluded.

Alert Template

ContentTypeFunction
△ CUSTOM - Execute Script - Scheduled Task - Create - Winget Update AllAlert TemplateExecutes the Script - Scheduled Task - Create - Winget Update All [Autofix] against the computers detected by the Internal Monitor - Execute Script - Scheduled Task - Create - Winget Update All
△ CUSTOM - Execute Script - Scheduled Task - Delete - Winget Update AllAlert TemplateExecutes the Script - Scheduled Task - Delete - Winget Update All [Autofix] against the computers detected by the Internal Monitor - Execute Script - Scheduled Task - Delete - Winget Update All

Implementation

  1. Import the following scripts from the ProSync plugin:

  2. Import the following internal monitors from the ProSync plugin:

  3. Import the following alert templates from the ProSync plugin:

    • △ CUSTOM - Execute Script - Scheduled Task - Create - Winget Update All
    • △ CUSTOM - Execute Script - Scheduled Task - Delete - Winget Update All
  4. Reload the system cache. Image

  5. Execute the Script - Scheduled Task - Create - Winget Update All [Autofix] against any online Windows 10 or Windows 11 computer with the SetEnvironment parameter set to 1 to create the system property and the EDFs. Image

  6. Configure the Extra Data Fields to initiate the solution as described in this document: Script - Scheduled Task - Create - Winget Update All [Autofix].

    Note: Marking the client-level EDF Winget Update All Task - Create will initiate the solution for the client.

  7. Configure the solution as follows:

    Navigate to Automation → Monitors within the CWA Control Center and set up the following:

FAQ

Q: How to disable the Winget Update All [Logged on User] task on the endpoints?
A:

Q: How to recreate the tasks on all Windows 10 and 11 computers in the environment?
A: Follow the steps described in the Reset - Extra Data Field - Winget_update_all_task_created article for the Environment Level Changes.

Q: How to recreate the tasks on all Windows 10 and 11 computers for a particular client?
A: Follow the steps described in the Reset - Extra Data Field - Winget_update_all_task_created article for the Client Level Changes.

Q: How to delete the tasks created on an endpoint?
A: Upon marking the Computer-Level EDF Winget Update All Task - Exclude, the Execute Script - Scheduled Task - Delete - Winget Update All internal monitor executes the Scheduled Task - Delete - Winget Update All [Autofix] script to remove the tasks from the endpoint.

Q: How to remove the tasks from all machines of a location?
A: Upon marking the Location-Level EDF Winget Update All Task - Exclude, the Execute Script - Scheduled Task - Delete - Winget Update All internal monitor executes the Scheduled Task - Delete - Winget Update All [Autofix] script to remove the tasks from all Windows 10 and 11 machines of the location.

Q: How to remove the tasks from all machines of a client?
A: Upon unmarking the Client-Level EDF Winget Update All Task - Create, the Execute Script - Scheduled Task - Delete - Winget Update All internal monitor executes the Scheduled Task - Delete - Winget Update All [Autofix] script to remove the tasks from all Windows 10 and 11 machines of the client.