In this blog post, we’ll walk you through the steps to add a registry key to Windows 11 using Intune.
As more and more businesses move towards cloud-based solutions, the need for efficient and centralized device management has become increasingly important. Microsoft Intune is a cloud-based service that allows administrators to manage devices and applications from a single platform, and it can be used to add registry keys to Windows 11 devices.
To apply registry keys to Intune-managed machines we need to use PowerShell cmdlets and push them to managed machines using a PowerShell script.
PowerShell Script
The following script will add a registry setting to a Windows 10 \ 11 machine. Use the variables to add the registry key details. The script also checks if the key exists before creating it.
$Path = "HKCU:\Software\ntweeklycom\"
$Name = "blogname"
$value = "ntweeky.com"
$type="REG_SZ" # String
if((Test-Path -LiteralPath $path) -ne $true) { New-Item $Path -force -ea SilentlyContinue };
New-ItemProperty -LiteralPath $path -Name $name -Value $value -PropertyType $type -Force -ea SilentlyContinue;
Add Script to Intune
To deploy the key to machines,
Open the Intune console
Click on Devices
Under Policy click on Scripts
Click Add

Name the script and click next to the configuration part.
Upload the script
Select Yes to Run this script using logged-on credentials
Select No to Enforce script signature check
Select Yes to Run script in 64 bit PowerShell Host

Assign the script to users or groups and wait for the policy to apply.
Leave a Reply