Skip to main content

Scheduled Task - 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). By default, "WingetUpdateAll_UserTask_Disable" at the company, site, and endpoint level is set to "yes," which means disabled.

To enable the Winget Update All [Logged on User], you need to change the custom field WingetUpdateAll_UserTask_Disable to "No" for the required company, site, or endpoint level.

Police Car Light
Be aware that user-level scheduled tasks Winget Update All [Logged on User] may prompt for UAC to the logged-in user if enabled. Police Car Light

Associated Content

Custom Fields

ContentTypeLevelDefaultFunction
WingetUpdateAll_Task_CreateFlagCompanyNoMark this custom field to create Winget Update All (System And Logged on User) tasks for the company's Windows 10 and 11 computers.
WingetUpdateAll_Task_DeleteFlagCompanyNoMark this custom field to delete Winget Update All (System And Logged on User) tasks for the company's Windows 10 and 11 machines.
WingetUpdateAll_UserTask_DisableFlagCompanyYesSet this custom field to "No" to enable the user-level Winget update all tasks for Windows 10 and 11 of the company.
WingetUpdateAll_Task_ExcludeFlagSiteNoMark this custom field to exclude the site from Winget Update All Task creation and remove the created tasks for the site's Windows 10 and 11 computers.
WingetUpdateAll_UserTask_DisableFlagSiteNoSet this custom field to "Yes" to disable the user-level Winget update all tasks for Windows 10 and 11 of the site.
WingetUpdateAll_Task_ExcludeFlagEndpointNoMark this custom field to exclude the computer from Winget Update All Task creation and remove the created tasks for the machine.
WingetUpdateAll_UserTask_DisableFlagEndpointNoSet this custom field to "Yes" to disable the user-level Winget update all tasks for the Windows machines.
WingetUpdateAll_Task_ResultTextEndpointNoThis custom field stores the outcome of both Scheduled Task Winget Update All (Create) and Scheduled Task Winget Update All (Delete) tasks. It stores whether the task succeeded or failed.

Device Groups

ContentTypeFunction
Winget Update All (Task Create)DynamicThis group detects Windows 10 and 11 computers where Winget Update All [System] and Winget Update All [Logged on User] tasks are missing and are opted in for the Winget Update All Scheduled task creation solution.
Winget Update All (Task Delete)DynamicThis group identifies Windows 10 and 11 computers with the presence of Winget Update All [System] and Winget Update All [Logged on User] tasks and opts to remove these scheduled tasks.

Tasks

ContentTypeFunction
Scheduled Task Winget Update All (Create)Script EditorCreate the tasks if opted-in for creation.
Scheduled Task Winget Update All (Delete)Script EditorDelete the task if opted-in for deletion.

Implementation

1.

Create the following custom fields:

2.

Create the following device groups:

3.

Create and deploy the following tasks: