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
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2023/03/image-9.png)
Name the script and click next to the configuration part.
Upload the script
Set Yes to Run this script using logged-on credentials
Select No to Enforce script signature check
Use Yes to Run script in 64-bit PowerShell Host
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2023/03/image-10-1024x344.png)
Assign the script to users or groups and wait for the policy to apply.