Microsoft Intune – How to modify Windows 10 registry settings

batchmicrosoft-intunewindows-registry

Win32 app uses bat file to install software and edit registry keys. Registry keys are modified if I run bat file locally but not when run through via Intune because Intune runs installation as System.

I created a PowerShell script that works when run locally but if I use Intune registry keys are not modified.

How can I edit registry keys via Intune?

Intune PowerShell scripts
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'AutoAdminLogon' -Value 0

Win32 app bat file
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "AutoAdminLogon" /t REG_SZ /d "" /f

Best Answer

Try:

Set-ItemProperty -Path Registry::"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name "AutoAdminLogon" -PropertyType "DWORD" -Value "0" -Force 
Related Topic