I need to to programmatically (ideally via PowerShell) configure Outlook setting the options:
- "When sending e-mail, check address lists in this order:" to "Start with contact folders".
- "When opening the address book, show this address list first:" to "Outlook Address Book".
This problem has proved particularly elusive and I have been investigating this over the course of many hours so my consolidated findings may seem a bit thrown together.
Option #1
If I recall correctly, the following PowerShell commands successfully configured the options:
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\0a0d020000000000c000000000000046\" -Name "000b3d1c" -PropertyType "Binary" -Value 0x00,0x00 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\0a0d020000000000c000000000000046\" -Name "00033d1b" -PropertyType "Binary" -Value 0x02,0x00,0x00,0x00 -Force;
Option #2
Exporting the registry key HKCU\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>
to a REG file, recreating the mail profile, importing the REG file, and opening Outlook shows that the options are set as desired. So, it can be done via the registry.
Process Monitor, configured to monitor registry operations with filters Process Name is OUTLOOK.EXE Include
and Operation is RegSetValue Include
, always outputs slightly different results but the consistent results are:
15:48:56.9983649 OUTLOOK.EXE 531284 RegSetValue HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles\Student\9207f3e0a3b11019908b08002b2a56c2\01023d06 SUCCESS Type: REG_BINARY, Length: 44, Data: 00 00 00 00 FE 42 AA 0A 18 C7 1A 10 E8 85 0B 65
15:48:56.9991115 OUTLOOK.EXE 531284 RegSetValue HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles\Student\0a0d020000000000c000000000000046\000b3d1c SUCCESS Type: REG_BINARY, Length: 2, Data: 00 00
15:48:56.9996963 OUTLOOK.EXE 531284 RegSetValue HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles\Student\0a0d020000000000c000000000000046\00033d1b SUCCESS Type: REG_BINARY, Length: 4, Data: 02 00 00 00
15:48:57.0052360 OUTLOOK.EXE 531284 RegSetValue HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles\Student\4ae4e14443f96d4982c25a0b9340e560\000b048b SUCCESS Type: REG_BINARY, Length: 2, Data: 01 00
15:49:03.0985853 OUTLOOK.EXE 531284 RegSetValue HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles\Student\0a0d020000000000c000000000000046\1102039b SUCCESS Type: REG_BINARY, Length: 308, Data: 01 00 00 00 1D 01 00 00 00 00 00 00 14 00 00 00
15:49:03.0990695 OUTLOOK.EXE 531284 RegSetValue HKCU\Software\Microsoft\Office\15.0\Outlook\Profiles\Student\0a0d020000000000c000000000000046\000b0415 SUCCESS Type: REG_BINARY, Length: 2, Data: 00 00
However, the following PowerShell commands did not successfully configure the options:
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\0a0d020000000000c000000000000046\" -Name "000b046b" -PropertyType "Binary" -Value 0x01,0x00 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\9207f3e0a3b11019908b08002b2a56c2\" -Name "01023d06" -PropertyType "Binary" -Value 0x00,0x00,0x00,0x00,0xFE,0x42,0xAA,0x0A,0x18,0xC7,0x1A,0x10,0xE8,0x85,0x0B,0x65 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\0a0d020000000000c000000000000046\" -Name "000b3d1c" -PropertyType "Binary" -Value 0x00,0x00 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\0a0d020000000000c000000000000046\" -Name "00033d1b" -PropertyType "Binary" -Value 0x02,0x00,0x00,0x00 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\0a0d020000000000c000000000000046\" -Name "000b0340" -PropertyType "Binary" -Value 0x01,0x00 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\9207f3e0a3b11019908b08002b2a56c2\" -Name "11023d05" -PropertyType "Binary" -Value 0x02,0x00,0x00,0x00,0x1E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x00,0x00,0x00 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\b9e1c8a47102f24688ede3f23cbc5224\" -Name "0102663b" -PropertyType "Binary" -Value 0x0F,0x00,0x01,0x00,0x8C,0x01,0x21,0x00 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\0a0d020000000000c000000000000046\" -Name "1102039b" -PropertyType "Binary" -Value 0x01,0x00,0x00,0x00,0x1D,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x14,0x00,0x00,0x00 -Force;
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\<Outlook version>\Outlook\Profiles\<mail profile name>\0a0d020000000000c000000000000046\" -Name "000b0415" -PropertyType "Binary" -Value 0x00,0x00 -Force;
Set Outlook's 'show this address list first' option suggests that this can be done by use of ComObjects but tests showed that Outlook detected the activity as malicious and prompted with a security warning that required manual intervention, which, obviously, is problematic in that it is not 100 % programmatic.
https://social.technet.microsoft.com/Forums/exchange/en-US/85a392d4-fc85-43c5-9c02-c07ec86e2ade/default-address-list?forum=exchangesvrclientslegacy and https://social.technet.microsoft.com/Forums/office/en-US/6bb9b40f-b794-41ce-93b4-711e77c53607/gal-default-adress-book-gpo says that registry key *\<mail profile name>\9207f3e0a3b11019908b08002b2a56c2
-> value 01023d06
is responsible which was detected by Process Monitor but, as referenced above, it has not worked in my testing.