For registry keys that need to be set during application installation, use the Win32 application method. This is ideal for software-specific registry settings.
First, download the Microsoft Win32 Content Prep Tool v1.11.4 from:
https://github.com/Microsoft/Microsoft-Win32-Content-Prep-Tool/releases
Create a folder structure for your Win32 app:
mkdir C:\IntuneApps\RegistryConfig
cd C:\IntuneApps\RegistryConfig
Create an install.ps1 script:
# install.ps1 - Registry configuration during app deployment
Start-Transcript -Path "C:\Windows\Temp\RegistryConfig-Install.log"
try {
# Create application-specific registry keys
$appRegPath = "HKLM:\SOFTWARE\MyCompany\ApplicationSettings"
New-Item -Path $appRegPath -Force | Out-Null
# Set configuration values
New-ItemProperty -Path $appRegPath -Name "ConfigVersion" -Value "2.1" -PropertyType String -Force
New-ItemProperty -Path $appRegPath -Name "AutoUpdate" -Value 1 -PropertyType DWord -Force
New-ItemProperty -Path $appRegPath -Name "TelemetryEnabled" -Value 0 -PropertyType DWord -Force
Write-Output "Registry configuration completed successfully"
exit 0
}
catch {
Write-Error "Failed to configure registry: $($_.Exception.Message)"
exit 1
}
finally {
Stop-Transcript
}
Create the .intunewin package:
IntuneWinAppUtil.exe -c "C:\IntuneApps\RegistryConfig" -s "install.ps1" -o "C:\IntuneApps\Output"
Verification: Check that the .intunewin file was created successfully in the output directory before proceeding to upload it to Intune.