-
Not necessarily an issue but will there be any support for Winget to be run by the system account? I've been testing out it's usage currently so that we can use it within Intune prior to the full release for testing purposes. Unfortunately when run as the System account Winget can't be detected and run by it. Perhaps this is an issue on my end but will this ever been something that will be usable in future? Side note: I think this is absolutely fantastic and I'm looking forward to where this will go. I believe it will make Application management for Enterprises infinitely better. |
Beta Was this translation helpful? Give feedback.
Replies: 37 comments 83 replies
-
@beirbones can you share more specifics about your scenario? I'd love to understand what you're hoping to be able to do. I'll also look into the issue with the system account. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
+1 for this. Currently, in my Windows Virtual Desktop environment, I've a "choco upgrade all -y" that runs as system daily, and upgrades the supported 3rd party stuff. |
Beta Was this translation helpful? Give feedback.
-
The problem comes from our current release vehicle, which is inside an MSIX package. The system cannot register packages for use (that I know of). We would need to investigate if this is indeed possible, and if not, how we would enable the scenario without it. |
Beta Was this translation helpful? Give feedback.
-
So has there been any further consideration to altering the usage of the MSIX package as the release vehicle? Being able to execute this as the "system" account is a critical component to making this useful in a corporate (aka managed) environment. Otherwise it's just additional work to create a software repository so that users can install their own applications, subsequently requiring them to have local administrative privileges on their machines. |
Beta Was this translation helpful? Give feedback.
-
@jorgytim we have discussed the ability to filter/restrict results by |
Beta Was this translation helpful? Give feedback.
-
The reason I reference the MSIX is that in a previous comment it was said that the release vehicle (MSIX) is what's limiting the ability to install WinGet for use by the system account (all users vs. user-specific package). This is the biggest drawback right now to Winget is that it is deployed on a per-user basis, therefore cannot be accessed by the system account. In order for managed environments to be able to call Winget (by service, scheduled task, or other mechanism) to automatically install packages, use of the system account is critical. As someone had previously mentioned, deploying this to regular users and having them need to elevate to install packages makes such a great toolset unusable for businesses that have worked so hard to secure their endpoints. Plus the ability to "push" software to a machine via Winget would be a huge win (aka, ability to setup a scheduled task to download/install packages), and currently it's user-driven due to the lack of ability to deploy this to the machine. |
Beta Was this translation helpful? Give feedback.
-
@jorgytim On a sightly offensive note , I really do wonder how big brains think inside Microsoft since 2012. |
Beta Was this translation helpful? Give feedback.
-
I wonder why this was moved to discussion from the issues list? One the release milestones there are items for machine vs. user applications, and with this the winget application itself needs to be addressed to accomplish this goal. Can we move this to a feature request and see if the community votes on having the winget package installable for "all users", as opposed to per-user? |
Beta Was this translation helpful? Give feedback.
-
@jorgytim it's a duplicate of #637, and the limitation is currently external with the installer and how MSIX works. This comment has links to the external issues: #637 (comment). The work item on the backlog was to support packages being installed either in User space or Machine space. |
Beta Was this translation helpful? Give feedback.
-
@beirbones This is a possible work around for Intune: https://docs.microsoft.com/en-us/mem/intune/apps/intune-management-extension#create-a-script-policy-and-assign-it We tested this in a lab environment. |
Beta Was this translation helpful? Give feedback.
-
I'll confirm, but I believe the user was configured as a "local admin" on the both machines. I'll ask my colleague to update this issue with more specifics here. |
Beta Was this translation helpful? Give feedback.
-
OK, its been a year since this all discussion starter. Whats changed? |
Beta Was this translation helpful? Give feedback.
-
Cross posting my response from Issue 367 ([https://github.com//issues/637#issuecomment-955055704]): We have an automation tool where I work that I'd hoped to use WinGet to help manage our lab workstations. I encountered the same problem, but actually have a solution (at least for systems 20H2 and higher that have WinGet installed). Windows Apps are actually stored under
Let me know if you have any questions or find this doesn't work for you. This is now a game changer for us! |
Beta Was this translation helpful? Give feedback.
-
Here is the idea I had to control what software is upgraded. Get a list of installed software and index it on a hashtable to Winget package IDs specified. # Get path for Winget executible
$Winget = gci "C:\Program Files\WindowsApps" -Recurse -File | where name -like AppInstallerCLI.exe | select -ExpandProperty fullname
# Uninstall registry key locations
$uninstallKeys = "registry::HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall", "registry::HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
# Build list of installed software based on uninstall keys
foreach ($key in $uninstallKeys)
{
$SoftwareList += Get-Childitem $key | Get-ItemProperty | where displayname | select -ExpandProperty displayname
}
# Hash table to translate installed software to Winget Package IDs
$WinGetPackages = @{
'Google Chrome' = 'Google.Chrome'
'Mozilla Firefox (x64 en-US)' = 'Mozilla.Firefox'
'Microsoft OneDrive' = 'Microsoft.OneDrive'
'Notepad++' = 'Notepad++.Notepad++'
'Microsoft Edge' = 'Microsoft.Edge'
}
# Index software displaynames in hash table
$WingetPackages = $WinGetPackages[$SoftwareList]
# Remove null values from array
$WingetPackages = $WinGetPackages | where {$_}
# Run the upgrade command for installed software only based on our package list
foreach ($Package in $WinGetPackages){
write-host "Upgrading $($Package)"
& $Winget upgrade --id $Package -h --accept-package-agreements --accept-source-agreements
} |
Beta Was this translation helpful? Give feedback.
-
Hello,
The –accept parameters are in the command that I was using before listed below.
.\AppInstallercli.exe install --id Discord.Discord --silent --accept-package-agreements --accept-source-agreements
But following that parameter that you provided this is what I get.
***@***.***
Discord itself doesn’t install, but if I use the same command as winget on the local user it works fine. I am doing this via psexec -I -s powershell.exe to make sure I get on the system user. I configured it was nt authority\system via the whoami command.
|
Beta Was this translation helpful? Give feedback.
-
I exactly face same issue can someone please help me with if some one has proper resolution for this? |
Beta Was this translation helpful? Give feedback.
-
Thank you for creating this. winget is great and I look forward to watching how it progresses! To provide background on a somewhat different use case, where I work we use an RMM to remotely support different companies. I am looking for a way to use the RMM to run a PowerShell script (which can run either as Local System or the currently logged in user who normally is not a local administrator on the machine) to install winget. Once winget is installed, I need the Local System account to be able to execute winget commands so the RMM manage apps with winget. |
Beta Was this translation helpful? Give feedback.
-
For anyone following this thread, this guy wrote some really cool stuff in response to a question I posted on Reddit. https://github.com/arsscriptum/PowerShell.Reddit.Support/tree/main/john but there's still the issue of winget needing to be run in the logged on user context so I am using this module: https://github.com/KelvinTegelaar/RunAsUser so I can start the process as local system and run the "real" script as the logged on user without the user needing admin rights. But for the record allow me to say that Winget.exe absolutely sucks from the perspective of someone who has been managing devices for 20+ years. |
Beta Was this translation helpful? Give feedback.
-
How is this going to replace the Business Store for apps? You cant even run winget from a system context. Trying to run this from an RMM agent is like hitting your head against a brick wall. The package manager is awesome, but there is no way this is going to work from an enterprise managed level. No way. When you have hundreds and thousands of computers to manage, logging into each one and running winget as a users context is not scalable and very inefficient use of time. Is there any official update on if this is going to change? Sounds like the Microsoft store for business is decommissioned in a few months. |
Beta Was this translation helpful? Give feedback.
-
This isn't going to help everyone, but hopefully someone We have been using Group policy to kick off install.cmd on startup, install.cmd containing myawesomepackage.exe /s I was using Just-Install until I recently found out it stopped, it was still working to install packages but they were out of date After trial and error I got this working with winget as well Things I'll likely need to improve on is creating better way of calling the package instead of a hard path, version 1.18.2691 came out yesterday so I should be fine for a while Another thing to note is Winget will only use reputable sources, so you can't create your own repo |
Beta Was this translation helpful? Give feedback.
-
I'm currently deploying win32apps via Intune and winget successfully using the following code (example installing Azure Data Studio).
|
Beta Was this translation helpful? Give feedback.
-
I know my biggest use case is not "machine wide" installs, but handling any install that prompts for UAC. I would be happy if I could have Intune scope handle the elevation on behalf of the users (user, machine, elevated) vs running in SYSTEM. I have not figured out a good trick to do that without writing some custom process handling that felt too fragile. |
Beta Was this translation helpful? Give feedback.
-
The Microsoft.WinGet.Client PowerShell module (technically pre-release, but not marked that way due to limitations of the PowerShell Gallery) has the ability to run in System context. This will not work for packages that are scoped to a single user, but for machine wide installs it does. |
Beta Was this translation helpful? Give feedback.
-
MS has the opportunity to improve the quality of life for millions of IT admins by making Winget work as SYSTEM. As this discussion shows using it in tandem with a deployment (RMM) tool like inTune, SCCM, Altiris etc would be absolutely game changing. The current deployment method is rather unless to us. MS, please take on the mass of feedback you have been given here and put the proper solution in place. |
Beta Was this translation helpful? Give feedback.
-
Do you have any links please?
…On Mon, Nov 13, 2023 at 4:01 pm, John Marcum ***@***.***(mailto:On Mon, Nov 13, 2023 at 4:01 pm, John Marcum <<a href=)> wrote:
WinGet works in System context now. There's several blogs about this.
—
Reply to this email directly, [view it on GitHub](#962 (reply in thread)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ALBTDDZ2WKXDTN7FKFMJVODYEI77FAVCNFSM4454EUAKU5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TONJVGU3TONI).
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I was shocked that even after 4 years this is still not adressed fixed. Workarounds are not working for me ( except for install ). But without search and stuff this is not applicable in our RMM tool. This would be such a game changer, but otherwise it is not usable in that form in any bigger IT department... |
Beta Was this translation helpful? Give feedback.
-
SCCM compliance setting with SYSTEM rights Set-Location "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe"
# Define the application you want to detect
$targetApp = "Insecure.Nmap"
# Get a list of installed applications using Winget
$installedApps = .\winget.exe list --accept-source-agreements
# Check if the target application is installed
if ($installedApps -like "*$targetApp*") {
Write-Host "True"
} else {
Write-Host "False"
}
Remedation script - Set-Location "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe"
.\winget.exe install Insecure.Nmap --force --accept-package-agreements --accept-source-agreements SCCM Application PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -Command "& {Set-Location 'C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe'; .\winget.exe install Insecure.Nmap --force --accept-package-agreements --accept-source-agreements}" Detection - Set-Location "C:\Program Files\WindowsApps\Microsoft.DesktopAppInstaller_*_x64__8wekyb3d8bbwe"
# Define the application you want to detect
$targetApp = "Insecure.Nmap"
# Get a list of installed applications using Winget
$installedApps = .\winget.exe list --accept-source-agreements
# Check if the target application is installed
if ($installedApps -like "*$targetApp*") {
Write-Host "True"
} else {
} |
Beta Was this translation helpful? Give feedback.
The problem comes from our current release vehicle, which is inside an MSIX package. The system cannot register packages for use (that I know of). We would need to investigate if this is indeed possible, and if not, how we would enable the scenario without it.