Skip to content

Connect devices with winget

Devices reach your source through a source key. With no key, a device sees nothing. Revoking a key stops every device that uses it from getting updates.

  • Permission: Manage settings (settings:write) to create or revoke keys.
  • Plan: all plans.
  • At least one approved version, so you can test. See the Quickstart.
  1. Go to Devices & Access › Connect devices.
  2. Under Point WinGet at your source, choose Create source key.
  3. Enter a Label. Name it after the deployment channel, for example Intune: all laptops.
  4. Choose Create key.
  5. Copy the winget source add command. It is shown once.
  6. Choose Test connection. A working key answers “Connected.”
  7. Choose I’ve copied it.

Use one key per deployment channel, so you can revoke each one on its own.

Run the command in an elevated PowerShell or Command Prompt:

Terminal window
winget source add --name contoso --arg https://api.endpointworks.com/api/winget/t/ews_xxxxxxxx --type Microsoft.Rest

Then check it:

Terminal window
winget source list
winget search 7zip --source contoso

Expected result: winget search finds the package, and winget show 7zip.7zip --source contoso --versions lists only the versions you approved.

Terminal window
winget install --id 7zip.7zip --source contoso --scope machine

Add --scope machine for portable apps when you install elevated. Without it, winget installs a portable app for the current user, and an elevated winget uninstall can’t remove it later.

Tool How
Intune A platform script or a Win32 app that runs the winget source add command as System.
Group Policy A computer startup script that runs the command.
RMM or ConfigMgr Run the command as SYSTEM.

The command contains the key. Treat it like a password and keep it out of tickets and chat.

  1. Go to Devices & Access › Connect devices.
  2. Choose Revoke on the key, then Revoke source key.

Result: devices using that key get no updates and can no longer search or install from the source. Add a new key to the devices that should keep access.

Symptom Cause Fix
Test connection says the source doesn’t recognise the key The key was revoked, or mistyped Create a new key.
Test connection says the key is rate limited Too many requests in a short time Retry in a minute.
winget source add fails with a certificate or connection error The device can’t reach the API host over HTTPS Check proxy and TLS inspection rules for the API host.
No package found matching input criteria The version isn’t approved, or it was blocked Check Approvals. A blocked version isn’t served.
Uninstall fails with 0x8A15007D A portable app was installed in user scope Reinstall with --scope machine.

More: winget errors.