Outlook: how to programmatically read auto archive settings


Auto archive is a purely Outlook feature (i.e. the settings are not stored in the mailbox), and the settings are not exposed in the object model.  The settings are stored in the registry, however, so it is possible to read the information from there.  Note though, that this is completely unsupported (just as we do not support modifying an Outlook profile in the registry).  Having said this, most of the settings have remained the same since Outlook 2003 (probably earlier, but I haven't tested any earlier clients), and so long as you are just looking to read the settings (not set them), then this can be fairly easily done.

Most of the auto archive settings for a profile will be found in the registry key HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\<PROFILE>\0a0d020000000000c000000000000046, where <PROFILE> is the profile name.  The values in this key are undocumented, so you'll have to do your own investigation as to what they do (an easy way of doing this is to change your auto archive settings, and see what has changed in the registry).

Whether auto archive is enabled or not is an Outlook setting rather than a profile setting (it is either on for all profiles, or off).  By default it is on, but this can be overridden by another registry key HKCU\Software\Microsoft\Office\11.0\Outlook\Preferences\DoAging.  Note the Outlook version number - this key changes for each Outlook version, so you'll need to update accordingly.

And finally, I wrote a sample script that will report a couple of auto archive settings.  It will report whether auto archive is enabled, and also the archive file for each profile.  It also uses the Outlook Object model to read and report the Outlook version (this is required to read the DoAging key correctly).  This script seems to work in Outlook 2003 - 2013, but you would need to do your own testing.  It is a VB script, and you will need to modify the log file location (beginning of the script) appropriate to your system.

 

autoarchive_report.vbs

Comments (6)

  1. CSorg says:

    Thanks, exactly what I was looking for.

    Tiny mistake in de registry path, it's

    HKCUSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfiles<PROFILE>a0d020000000000c000000000000046

    and not

    HKCUSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesOutlook<PROFILE>a0d020000000000c000000000000046

    In your example the name Outlook is the Profile name (which is mostly the Default while configuring Outlook with the wizard)

  2. I've updated the article, thanks for pointing that out!

  3. Andy Lake says:

    This is awesome, but for the purpose of finding just the Active .pst files currently used, I require a the output of the 1102044e Binary Value which shows what archives are in use and their path location.

    We need this to be able to work out what Active .pst files are in use to move them off to the Users H: drive

    The header information that it currently shows is very useful and i would like to keep.

    COMPUTER: 01267-9DSK22

    USER: alake

    —————————————-

    Outlook version: 14.0.0.6117

    PROFILE: Outlook

    Any help is appreciated.

    I did try to modify the 001f0324 and substitute with 1102044e but get a invalid Procedure call at line 101 Char 3

  4. Josh Gold says:

    If you are running Outlook 2013, I think line 22 should read as follows:

    Const PROFILES = "SoftwareMicrosoftOffice15.0OutlookProfiles"

  5. Josh Gold says:

    FYI, you will also need to change line 23 to a valid location.

  6. Alexandr says:

    I have trouble with Chr

    it is line 101,3

    What it could be?

    Thank you for your answer

Skip to main content