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'supgrade all command
upon system boot (after network connection) under the SYSTEM context. - The
Winget Update All [Logged on User]
task initiates Winget'supgrade 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.
Be aware that user-level scheduled tasks Winget Update All [Logged on User]
may prompt for UAC to the logged-in user if enabled.
Associated Content
Custom Fields
Content | Type | Level | Default | Function |
---|---|---|---|---|
WingetUpdateAll_Task_Create | Flag | Company | No | Mark 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_Delete | Flag | Company | No | Mark 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_Disable | Flag | Company | Yes | Set this custom field to "No" to enable the user-level Winget update all tasks for Windows 10 and 11 of the company. |
WingetUpdateAll_Task_Exclude | Flag | Site | No | Mark 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_Disable | Flag | Site | No | Set this custom field to "Yes" to disable the user-level Winget update all tasks for Windows 10 and 11 of the site. |
WingetUpdateAll_Task_Exclude | Flag | Endpoint | No | Mark this custom field to exclude the computer from Winget Update All Task creation and remove the created tasks for the machine. |
WingetUpdateAll_UserTask_Disable | Flag | Endpoint | No | Set this custom field to "Yes" to disable the user-level Winget update all tasks for the Windows machines. |
WingetUpdateAll_Task_Result | Text | Endpoint | No | This 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
Content | Type | Function |
---|---|---|
Winget Update All (Task Create) | Dynamic | This 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) | Dynamic | This 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
Content | Type | Function |
---|---|---|
Scheduled Task Winget Update All (Create) | Script Editor | Create the tasks if opted-in for creation. |
Scheduled Task Winget Update All (Delete) | Script Editor | Delete the task if opted-in for deletion. |
Implementation
1.
Create the following custom fields:
- Company - WingetUpdateAll_Task_Create
- Company - WingetUpdateAll_Task_Delete
- Company - WingetUpdateAll_UserTask_Disable
- Site - WingetUpdateAll_Task_Exclude
- Site - WingetUpdateAll_UserTask_Disable
- Endpoint - WingetUpdateAll_Task_Exclude
- Endpoint - WingetUpdateAll_Task_Result
- Endpoint - WingetUpdateAll_UserTask_Disable
2.
Create the following device groups:
3.
Create and deploy the following tasks: