How to Programmatically Reset Outlook 2013 to First-Run State: A Complete Guide for Developers


1 views

When migrating from on-premise Exchange to Office 365, we often need to completely reset Outlook profiles. The standard approach has limitations:

  1. Deleting profiles through Control Panel leaves registry artifacts
  2. Manual registry edits don't always persist
  3. Built-in Outlook switches like /cleanprofile were deprecated

Outlook 2013 stores profile information in these key registry paths:


HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Setup
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles
HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Settings

Method 1: Complete Registry Purge (PowerShell)

This script removes all Outlook profile traces:


Remove-Item -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Setup" -Recurse -Force
Remove-Item -Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" -Recurse -Force
Remove-Item -Path "HKCU:\Software\Microsoft\Office\Outlook\Settings" -Recurse -Force
Stop-Process -Name "outlook" -Force

Method 2: Deployment-Friendly Batch Script

For mass deployments via SCCM or Group Policy:


@echo off
REG DELETE "HKCU\Software\Microsoft\Office\15.0\Outlook\Setup" /f
REG DELETE "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" /f
taskkill /f /im outlook.exe

After resetting, you can automate profile creation:


$outlook = New-Object -ComObject Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
$namespace.AddStore("Outlook") # Creates default profile
  • Always close Outlook before running these scripts
  • Backup registry keys before deletion
  • Office 2013 uses version 15.0 in registry paths
  • Test thoroughly in non-production first

During Office 365 migrations, many administrators encounter stubborn Outlook profile artifacts that survive standard deletion methods. The Windows Messaging Subsystem registry branch maintains hidden references even after removing profiles through Control Panel.

When GUI methods fail, manual registry editing provides complete removal:


Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles]

For enterprise deployment, this PowerShell script handles profile cleanup:


# Requires admin privileges
$profilePath = "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles"

if (Test-Path $profilePath) {
    Remove-Item -Path $profilePath -Recurse -Force
    Write-Output "Outlook profiles registry branch removed successfully"
    
    # Optional: Reset first-run flag
    Set-ItemProperty -Path "HKCU:\Software\Microsoft\Office\15.0\Outlook\Setup" -Name "First-Run" -Value 1
} else {
    Write-Warning "Outlook profiles registry path not found"
}

For large-scale migrations, combine with Office 365 deployment tools:


# Office 365 Click-to-Run reset parameters
setup.exe /configure configuration.xml

Sample configuration.xml:


<Configuration>
    <RemoveMSI All="True"/>
    <Display Level="None"/>
    <Logging Type="standard" Path="%temp%\Office365_Reset"/>
    <Property Name="FORCEAPPSHUTDOWN" Value="TRUE"/>
</Configuration>

After running cleanup scripts, verify complete reset by:

  1. Launching Outlook.exe /firstrun
  2. Checking for default "Outlook" profile prompt
  3. Confirming registry key recreation with timestamp