SCCM Package Registry Keys: Setting Current User Values

Amending current-user (HKCU) registry keys from an SCCM package is a genuinely awkward problem: packages normally run in the SYSTEM context, but HKCU only exists for a logged-in user’s session, so a SYSTEM-context install can’t directly write to a specific user’s hive the way it can with HKLM. The General Approach The common workaround is […]

Creating Current User Registry Keys In A SCCM Package

Amending current-user (HKCU) registry keys from an SCCM package is a genuinely awkward problem: packages normally run in the SYSTEM context, but HKCU only exists for a logged-in user’s session, so a SYSTEM-context install can’t directly write to a specific user’s hive the way it can with HKLM.

The General Approach

The common workaround is to have your package trigger a small piece of logic that runs in the user’s context rather than trying to write HKCU directly from a SYSTEM-context installer:

  1. Package a .reg file containing the keys/values you want to set.
  2. Deploy a small script (batch or PowerShell) alongside it that imports the .reg file using reg import, but trigger that script to run in the user’s context — either via a scheduled task created to run “only when user is logged on,” a logon script, or (on modern ConfigMgr) an Application deployment set to install for the User rather than the Device, with “Install for user” behaviour.

Trying to force a HKCU write from a SYSTEM-context package by targeting HKEY_USERS<SID> directly is possible but fragile — it only works reliably if the target user is logged on and their hive is loaded at the exact time your package runs, so the “run as user” approaches above are generally more robust for production deployment.

Resources

⬇️

Get the download

Windows Hello Registry Fix is available as a free download.

Download Now →
⬇️

Get the download

PuTTy MSI Package is available as a free download.

Download Now →
🛠️

Gear We Recommend

Testing configs is easier with a dedicated admin machine set up right. Here’s the kit we use.

Browse our Windows Admin Toolkit picks on Amazon

As an Amazon Associate, TechyGeeksHome earns from qualifying purchases.


Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Active Directory, PowerShell, and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published over 1,500 practical guides covering real-world IT problems and solutions. When not solving IT problems,

Andrew develops free Windows utilities including Ultimate Settings Panel, which has been downloaded over 850,000 times.