Hey everyone,
I'm trying to automate the upgrade of common applications using `winget upgrade` across over 300 devices in my company. While it works perfectly when I execute it manually, I'm facing challenges in automating it through a Group Policy Object (GPO).
I've set up a GPO to run a batch script with the SYSTEM account so that it has the necessary admin privileges, but it seems like the SYSTEM account doesn't actually have access to `winget`. I even attempted to install `winget` for the SYSTEM account, but that didn't resolve the issue either.
I've been stuck on this for three days now and could really use some guidance. Has anyone else successfully done this or have ideas on a potential solution?
2 Answers
Check out this GitHub repo: https://github.com/Romanitho/Winget-AutoUpdate. It might have the automated solution you’re looking for!
If you're using a PowerShell script in the SYSTEM context, try this command:
`$wingetCmd = 'cd "C:Program FilesWindowsAppsMicrosoft.DesktopAppInstaller_*__x64__8wekyb3d8bbwe" && winget.exe upgrade --all --silent --accept-package-agreements --accept-source-agreements'`. This might help you run `winget` successfully through GPO!
Awesome find! I’ll definitely be looking into that for our deployments.