Outlook’s slow add-ins resiliency logic and how to always enable slow add-ins 5/5 (6)

1+

Overview

This post explains how to deploy registry settings that would force Outlook to always load a specific add-in.

The information in this post only applies to slow (VSTO) add-ins in Outlook 2013 or higher.  If Outlook disables your add-in to prevent a crash, this blog post isn’t for you.

This logic applies to all COM and VSTO add-ins.

Disclaimer

Outlook natively allows add-ins to be enabled one at a time. That’s the only official supported way to enable slow add-ins!

This blog post is a best effort to allow users to automate the process at a large scale. This doesn’t mean Microsoft CSS is obligated in any way to support this, it’s simply a best effort.

Requirements

Outlook 2013 or 2016.

How it works

Outlook 2013 and 2016’s resiliency logic is triggered when one of the criteria enumerated in the Performance criteria for keeping add-ins enabled section of the New in Outlook for developers MSDN article.

Outlook’s resiliency logic was introduced with Outlook 2013 and it builds on the foundation set by the resiliency logic in Outlook 2010. As opposed to 2010, Outlook 2013 allows controlling how slow add-ins are handled, giving the users the option to go with the default logic and disable add-ins that take longer than 1 second to load or unload for example, or choose to always enable a certain add-in.

One other aspect to note is that if a VSTO add-in requires a module that is not loaded in Outlook’s memory, the first add-in to require that module will incur a “penalty” for each additional module that is loaded. This will apply for all add-ins if a required module is not present, the load time of each module that is required will be added to the load time of the add-in.

In addition to modules, the first add-in to load will incur a penalty for loading the .Net Framework.

In conclusion:

  • The first add-in to be loaded will have a load time equal to: LOAD_NECESSARY_MODULES [+ LOAD_.NET_FRAMEWORK ] [+ LOAD_VSTO_RUNTIME] + RUN_ADDIN_STARTUP_CODE
  • All future add-ins to be loaded will have a load time equal to: LOAD_NECESSARY_MODULES + RUN_ADDIN_STARTUP_CODE.

IMPORTANT: Outlook’s resiliency logic thresholds are hard coded. For example, the startup time is set to 1000 milliseconds (1 second). This limit cannot be increased, but by following the instructions in this blog post you can tell Outlook to load the add-in despite a load time of more than 1 second. 

Detailed Steps

Registry

To work around the resiliency logic, one can use a simple .reg file and add the add-in to the trusted addins list or a Group Policy Object to deploy the same values that would be generated locally to all the users in the domain:

  1. Add a REG_SZ entry called ADDIN_NAME with a value data of 1 under HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Office\1x.0\Outlook\Resiliency\AddinList
  2. Set the LoadBehavior (US English spelling!) dword value to 3 under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins\ADDIN_NAME
  3. Delete the HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems key
  4. Re-create the HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems key
  5. Delete the HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList key
  6. Re-create the HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList key
  7. Add a dword entry called ADDIN_NAME with a value of 1 under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DoNotDisableAddinList
  8. Add a dword entry called ADDIN_NAME\dtype with a value of 0 under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData
  9. Add a dword entry called ADDIN_NAME with a value of 967a844d hexadecimal or 2524611661 decimal under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData

Where:

  • ADDIN_NAME is the name of the add-in as found under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins\
  • 1x.0 is the office version, for example 15.0 for Office 2013 and 16.0 for Office 2016

NOTE: The value at point #1 will always enable the add-in but it will also prevent the user from controlling the add-in load behaviour. To allow users to control the add-in (enable or disable it from the Outlook user interface), set a value data of “2” instead. 

NOTE: The value at point 9 always enables your add-in until Saturday, January 1st 2050 at 1:01:01 AM.

REG file example without user control

Windows Registry Editor Version 5.00  

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\1x.0\Outlook\Resiliency\AddinList]
"ADDIN_NAME"="1"

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins\ADDIN_NAME]
"LoadBehavior"=dword:00000003

[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems]

[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DoNotDisableAddinList]
"ADDIN_NAME"=dword:00000001

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData]
"ADDIN_NAME\dtype"=dword:00000000

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData]
"ADDIN_NAME"=dword:967a844d

REG file example with user control

 
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\1x.0\Outlook\Resiliency\AddinList]
"ADDIN_NAME"="1"

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins\ADDIN_NAME]
"LoadBehavior"=dword:00000003

[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems]

[-HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList]

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DoNotDisableAddinList]
"ADDIN_NAME"=dword:00000001

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData]
"ADDIN_NAME\dtype"=dword:00000000

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData]
"ADDIN_NAME"=dword:967a844d

GPO (Group Policy Object)

As far as group policy objects go, please find below the procedure:

  1. Open the Group Policy Management console on a domain controller
    Navigate to the domain node, right click it and select Create a GPO in this domain, and Link it here
  2. Give the GPO the desired name
  3. Right click the newly created GPO and click on Edit
  4. In the Group Policy Management Editor, expand Preferences under User Configuration
  5. Afterwards expand Windows Settings
  6. Right click Registry and create the following 9 entries:
Name            Order   Action      Hive            KeyValue                                    Name            Type        ValueData
ADDIN_NAME 1 Create HKEY_CURRENT_USER SOFTWARE\Policies\Microsoft\Office\1x.0\Outlook\Resiliency\AddinList ADDIN_NAME REG_SZ 1
LoadBehavior 2 Update HKEY_CURRENT_USER SOFTWARE\Microsoft\Office\Outlook\Addins\ADDIN_NAME LoadBehavior REG_DWORD 00000003
DisabledItems 3 Delete HKEY_CURRENT_USER SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems
DisabledItems 4 Create HKEY_CURRENT_USER SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DisabledItems
CrashingAddinList 5 Delete HKEY_CURRENT_USER SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList
CrashingAddinList 6 Create HKEY_CURRENT_USER SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\CrashingAddinList
ADDIN_NAME 7 Create HKEY_CURRENT_USER SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\DoNotDisableAddinList ADDIN_NAME REG_DWORD 00000001
ADDIN_NAME 8 Create HKEY_CURRENT_USER SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData ADDIN_NAME\dtype REG_DWORD 00000000
ADDIN_NAME 9 Create HKEY_CURRENT_USER SOFTWARE\Microsoft\Office\1x.0\Outlook\Resiliency\NotificationReminderAddinData ADDIN_NAME REG_DWORD 967a844d

PowerShell Script

Please find below a PowerShell script sample that sets the above registry settings. Please save the script block as Enable-AddIn.ps1.

The syntax to run the script is Enable-AddIn.ps1 -AddinName ADDIN_NAME, where add-in name is the name of the add-in to always enable. The script will run once and set a registry value as a checkpoint. To force it to run again you can use the –Force parameter.

For example:

  • Enable-AddIn.ps1 -AddinName MyAddIn to run the script once and always enable MyAddIn
  • Enable-AddIn.ps1 -AddinName MyAddIn -Force to always run the script and enable MyAddIn
  • Enable-AddIn.ps1 -AddinName MyAddIn -AllowUserControl to run the script once, always enable MyAddIn, and allow users to enable or disable the add-in manually from the Outlook user interface

For more information on how to configure a script via GPO, please check the following article: Assign User Logon Scripts

param(
[Parameter(Mandatory=$true)]
[string]$AddinName,
[Parameter(Mandatory=$false)]
[switch]$Force,
[Parameter(Mandatory=$false)]
[switch]$AllowUserControl
)

$AddinList = $null
$CrashingAddinList = $null
$DoNotDisableAddinList = $null

function Get-Key
(
[string]$ParentKey,
[string]$KeyName)
{
    for ($i = 0; $i -lt $KeyName.Split("\").Count; $i++)
    {
        try
        {
            $Key = get-item -Path ("{0}:\{1}" -f $ParentKey,($KeyName.split("\")[0..$i] -join "\"))
        }
        catch 
        {
            $Key = new-item -Path ("{0}:\{1}" -f $ParentKey,($KeyName.split("\")[0..$i] -join "\"))
        }
    }
    return $Key
}

$ErrorActionPreference = [System.Management.Automation.ActionPreference]::Stop
$OutlookVersion = (Get-ItemProperty HKLM:\SOFTWARE\Classes\Outlook.Application\CurVer)."(default)".Replace("Outlook.Application.", "")

if ($Force)
{
    $checkPoint = $null
}
else
{
    try
    {
        $CheckPoint = (Get-Item "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency" | Get-ItemProperty)."CheckPoint" -eq 1
    }
    catch
    {
        $checkPoint = $false
    }
}

if (-not $checkPoint)
{
    if ($AllowUserControl.IsPresent)
    {
        Get-Key -ParentKey HKCU -KeyName "Software\Policies\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\AddinList" | Set-ItemProperty -Name $AddinName -Value "2"
    }
    else
    {
        Get-Key -ParentKey HKCU -KeyName "Software\Policies\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\AddinList" | Set-ItemProperty -Name $AddinName -Value "1"
    }
    Get-Key -ParentKey HKCU -KeyName "Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\DoNotDisableAddinList" | Set-ItemProperty -Name $AddinName -Value 1
    Get-Key -ParentKey HKCU -KeyName "Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\DisabledItems" | Remove-Item
    Get-Key -ParentKey HKCU -KeyName "Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\DisabledItems" | Out-Null
    Get-Key -ParentKey HKCU -KeyName "Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\CrashingAddinList" | Remove-Item
    Get-Key -ParentKey HKCU -KeyName "Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\CrashingAddinList" | Out-Null
    Get-Key -ParentKey HKCU -KeyName "Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\NotificationReminderAddinData" | Set-ItemProperty -Name ([string]::Format("{0}\dtype",$AddinName)) -Value 2
    Get-Key -ParentKey HKCU -KeyName "Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\NotificationReminderAddinData" | Set-ItemProperty -Name $AddinName -Value 2524611661
    Get-Item "HKCU:\Software\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency" | Set-ItemProperty -Name "CheckPoint" -Value 1
}

NOTE: To allow users to control the add-in (enable or disable it from the Outlook user interface), replace “-value 1” with “-value 2” in the following script line: Get-Key -ParentKey HKCU -KeyName “Software\Policies\Microsoft\Office\$OutlookVersion.0\Outlook\Resiliency\AddinList” | Set-ItemProperty -Name $AddinName -Value 1

Notes

Please follow the instructions carefully and for best results use the PowerShell script above.

References

New in Outlook for developers

Assign User Logon Scripts

Change Log

Date

Author

Description

2nd Aug 2017

Andrei

Original post

31st Oct 2017

Andrei

Corrected the registry entries.

27th Nov 2017

Andrei

Added additional entries to account for crashing add-ins.

10th Dec 2018

Nat

Added additional entries for Outlook 2016.

16th Jan 2019

Andrei

Updated general info to include COM add-ins and explained the reg value that controls the time the add-in stays enabled.

9th Apr 2019

Andrei

Updated reg file examples and PowerShell script to allow user control. Changed the value type for the first value to REG_SZ instead of dword.

1+

Please rate this

7 thoughts on “Outlook’s slow add-ins resiliency logic and how to always enable slow add-ins

  1. Hello Andrei

    This is an excellent article and I am assuming that if the Addin has been force set to always load until 2050 -I will be a very old man by then :-), it will prevent the Outlook Notification that this Outlook Add-In started slowly banner from displaying. Is that a correct assumption?

    I never understood the load penalty for VSTO and .NET Framework. Thanks for the clear explanation!

    0
    1. Hi Greg,

      It depends on the Outlook version really, I believe older versions may still show the banner even though the add-in is enabled. If you experience this with the latest builds of 2016 or 2019 let me know and I’ll see if we can address it somehow.

      Andrei

      0
  2. Thanks for this Andrei, very useful! Do you know if it is possible to hide a Add-in from the Com Add-ins list to prevent a user from unloading it during an Outlook session, specifically for HKLM registered Add-ins?

    I know there used to be a key for Outlook 2010 “dontDisplayHKLMAddins” which would hide it, but I can’t get this working for more recent versions of Outlook. This would be a useful feature for security focused Add-ins where IT Admins rely on these Add-ins always being loaded.

    0
      1. I added the key under :
        Computer\HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Security
        DontDisplayHKLMAddins
        REG_DWORD
        Value: 1

        One thing to note is the Add-in is based on Add-in Express so isn’t a VSTO Add-in, do you know whether this should still work and, if not, if there are any other alternative ways to prevent a user from unchecking the Add-in in the COM Add-ins list?

        0
  3. hi i this is a Grate worke … but jea the Reg Delite would not Worke Korrect for me … so i Write the How Thing as .bat 😉

    reg delete HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\DisabledItems /f
    reg delete HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\CrashingAddinList /f

    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\DisabledItems /f
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\CrashingAddinList /f

    reg add HKCU\Software\Policies\Microsoft\Office\16.0\Outlook\Resiliency\AddinList /f /v CalDavSynchronizer.1 /t REG_SZ /d 1
    reg add HKCU\Software\Microsoft\Office\Outlook\Addins\CalDavSynchronizer.1 /f /v LoadBehavior /t REG_DWORD /d 00000003
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\DoNotDisableAddinList /f /v CalDavSynchronizer.1 /t REG_DWORD /d 00000001
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\NotificationReminderAddinData /f /v CalDavSynchronizer.1\dtype /t REG_DWORD /d 00000000
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\NotificationReminderAddinData /f /v CalDavSynchronizer.1 /t REG_DWORD /d 2524611661

    Pause

    0
  4. with versions Chois

    @ECHO OFF
    ECHO Choise your Office version 2010 2013 2016 2019
    SET /p wahl=

    if ‘%wahl%’ == ‘2010’ goto 2010
    if ‘%wahl%’ == ‘2013’ goto 2013
    if ‘%wahl%’ == ‘2016’ goto 2016
    if ‘%wahl%’ == ‘2019’ goto 2016
    Goto Ende

    :2010
    reg delete HKCU\Software\Microsoft\Office\10.0\Outlook\Resiliency\DisabledItems /f
    reg delete HKCU\Software\Microsoft\Office\10.0\Outlook\Resiliency\CrashingAddinList /f
    reg add HKCU\Software\Microsoft\Office\10.0\Outlook\Resiliency\DisabledItems /f
    reg add HKCU\Software\Microsoft\Office\10.0\Outlook\Resiliency\CrashingAddinList /f
    reg add HKCU\Software\Policies\Microsoft\Office\10.0\Outlook\Resiliency\AddinList /f /v CalDavSynchronizer.1 /t REG_SZ /d 1
    reg add HKCU\Software\Microsoft\Office\Outlook\Addins\CalDavSynchronizer.1 /f /v LoadBehavior /t REG_DWORD /d 00000003
    reg add HKCU\Software\Microsoft\Office\10.0\Outlook\Resiliency\DoNotDisableAddinList /f /v CalDavSynchronizer.1 /t REG_DWORD /d 00000001
    reg add HKCU\Software\Microsoft\Office\10.0\Outlook\Resiliency\NotificationReminderAddinData /f /v CalDavSynchronizer.1\dtype /t REG_DWORD /d 00000000
    reg add HKCU\Software\Microsoft\Office\10.0\Outlook\Resiliency\NotificationReminderAddinData /f /v CalDavSynchronizer.1 /t REG_DWORD /d 2524611661
    Pause
    goto Ende

    :2013
    reg delete HKCU\Software\Microsoft\Office\13.0\Outlook\Resiliency\DisabledItems /f
    reg delete HKCU\Software\Microsoft\Office\13.0\Outlook\Resiliency\CrashingAddinList /f
    reg add HKCU\Software\Microsoft\Office\13.0\Outlook\Resiliency\DisabledItems /f
    reg add HKCU\Software\Microsoft\Office\13.0\Outlook\Resiliency\CrashingAddinList /f
    reg add HKCU\Software\Policies\Microsoft\Office\13.0\Outlook\Resiliency\AddinList /f /v CalDavSynchronizer.1 /t REG_SZ /d 1
    reg add HKCU\Software\Microsoft\Office\Outlook\Addins\CalDavSynchronizer.1 /f /v LoadBehavior /t REG_DWORD /d 00000003
    reg add HKCU\Software\Microsoft\Office\13.0\Outlook\Resiliency\DoNotDisableAddinList /f /v CalDavSynchronizer.1 /t REG_DWORD /d 00000001
    reg add HKCU\Software\Microsoft\Office\13.0\Outlook\Resiliency\NotificationReminderAddinData /f /v CalDavSynchronizer.1\dtype /t REG_DWORD /d 00000000
    reg add HKCU\Software\Microsoft\Office\13.0\Outlook\Resiliency\NotificationReminderAddinData /f /v CalDavSynchronizer.1 /t REG_DWORD /d 2524611661
    Pause
    goto Ende

    :2016
    reg delete HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\DisabledItems /f
    reg delete HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\CrashingAddinList /f
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\DisabledItems /f
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\CrashingAddinList /f
    reg add HKCU\Software\Policies\Microsoft\Office\16.0\Outlook\Resiliency\AddinList /f /v CalDavSynchronizer.1 /t REG_SZ /d 1
    reg add HKCU\Software\Microsoft\Office\Outlook\Addins\CalDavSynchronizer.1 /f /v LoadBehavior /t REG_DWORD /d 00000003
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\DoNotDisableAddinList /f /v CalDavSynchronizer.1 /t REG_DWORD /d 00000001
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\NotificationReminderAddinData /f /v CalDavSynchronizer.1\dtype /t REG_DWORD /d 00000000
    reg add HKCU\Software\Microsoft\Office\16.0\Outlook\Resiliency\NotificationReminderAddinData /f /v CalDavSynchronizer.1 /t REG_DWORD /d 2524611661
    Pause
    :Ende

    0

Leave a Reply to Andrei Ghita Cancel reply

Your email address will not be published. Required fields are marked *