top of page
  • simon0685

Intune Win32 install behaviour (or behavior)

Updated: Mar 23, 2021


If you don’t already know when you are building a Win32 app package in Microsoft Endpoint Manager one of the decisions you have to make is whether you want the app it install under the system or user context.

Now 99% of the time you are probably going to choose system as you get the elevated permissions most app installs require… what about the other 1%, when is the user context the wright choice?


It could be many things that force your hand but one that came up for me was the need to import a list of “safe” email addresses into Outlook’s safe senders list (I know this is not the best way to manage these things, but I just had to do it… let us move on).


This is a perfect opportunity to take advantage of Intune’s User install behaviour (or behavior as it is spelt the US way in the portal) as we then get easy access to the users registry hive that we need to set the Outlook reg settings.

I used the PSADT kit to copy the source list of addresses in a txt file to the local machine and then add the import reg keys


Example below


New-Item -Path c:\files -ItemType directory

Copy-File -Path "$dirFiles\SafeSendersList.txt"

Destination "c:\files\SafeSendersList.txt"


Set-RegistryKey -Key 'HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\Mail' -Name 'JunkMailSafeSendersfile' -Value 'c:\files\SafeSendersList.txt'-Type String -ContinueOnError:$True

Set-RegistryKey -Key 'HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\Mail' -Name 'JunkMailImportLists' -Value 1 -Type DWord -ContinueOnError:$True


Set-RegistryKey -Key 'HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Options\Mail' -Name 'filesSafeSendersList' -Value $appVersion -Type String -ContinueOnError:$True



Notes on the above


  • Location of these Outlook reg keys have change to the new locations shown above so don’t believe the MS article.

  • I set the reg key “fileSafeSendersList” as a flag that I used in the Intune detection rules.

  • Don’t forget to clean up your work in the uninstall section for the PSADT package.

  • I could change the explicit reference to the ‘C’ drive to the PSADT $envSystemDrive variable (I am going to do that, leaving references to drive letters is just not a good idea)


Cheers everyone



505 views0 comments

Comments


Post: Blog2_Post
bottom of page