Introduction
If you manage Windows devices with Microsoft Intune, this is the only registry script you’ll ever need.
You need to configure a registry setting that isn’t in Settings Catalog. Maybe it’s a binary value like Outlook font preferences with no CSP support. Maybe you need to delete leftover registry keys from a legacy app. And you need it applied to all user profiles on shared devices – not just one.
Remediations in Intune can help, but writing scripts that handle all these scenarios correctly takes time.
This PowerShell template handles the hard parts:
- Runs as SYSTEM by design – manages both user and machine registry from one script, works in environments with strict AppLocker or WDAC policies, and avoids Constrained Language Mode restrictions
- Reaches HKCU settings for all users by enumerating SIDs in HKU
- Supports both traditional AD and Microsoft Entra ID joined devices
- Handles all registry types – String, DWord, Binary, MultiString
- Three actions: Set, Delete, and DeleteKey
Single template for both detection and remediation. Modify the configuration section, save two copies, upload to Intune. Done.









