3

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

JPX
  • 151
  • 1
  • 2
  • 6
  • 1
    can you provide a sample of PS code, which doesn't work? – batistuta09 Aug 17 '20 at 21:05
  • @batistuta09 `Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'AutoAdminLogon' -Value 0` – JPX Aug 18 '20 at 15:21
  • By default Intune use 32 bit PowerShell. Locally I use 64 bit PS. I tried 32 bit PS and no error was given but registry was not modified. I'll try to use 64 bit PS in Intune. – JPX Aug 18 '20 at 18:40

1 Answers1

3

Try:

Set-ItemProperty -Path Registry::"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -Name "AutoAdminLogon" -PropertyType "DWORD" -Value "0" -Force 
batistuta09
  • 8,723
  • 9
  • 21
  • You have to select "Run script in 64 bit PowerShell host". Intune's default setting is 32 bit PowerShell host. – JPX Aug 23 '20 at 10:11