Microsoft Outlook 2016 › Outlook Options › Other › AutoArchive
AutoArchive Settings
Supported on SUPPORTED_Windows7 (defined in the Windows templates)
What it does
If you enable this policy setting, the options specified in the AutoArchive dialog box are disabled.
What it writes
- Hive
- HKEY_CURRENT_USER
- Registry key
software\policies\microsoft\office\16.0\outlook\preferences
Why it needs changes for Intune
- Policy references a Windows supportedOn definition.
- ADMX-INTUNE-WINDOWS-SUPPORTEDON-REFERENCE
Options
| Option | Type | Registry value | Allowed values |
|---|---|---|---|
| Turn on AutoArchive | Checkbox | doaging |
On (1) or off (0) |
| Run AutoArchive every <x> daysDefault: 14 | Number | everydays |
1 to 60 |
| Prompt before AutoArchive runs | Checkbox | promptforaging |
On (1) or off (0) |
| Delete expired items (e-mail folders only) | Checkbox | deleteexpired |
On (1) or off (0) |
| Archive or delete old items | Checkbox | archiveold |
On (1) or off (0) |
| Show archive folder in folder list | Checkbox | archivemount |
On (1) or off (0) |
| Clean out items older thanDefault: 6 | Number | archiveperiod |
1 to 60 |
| During AutoArchiveDefault: Months | Drop-down list | archivegranularity |
|
| Permanently delete old items | Checkbox | archivedelete |
On (1) or off (0) |
Configure and deploy
Choose a state and the option values; the output below is generated from the template for exactly that.
Enabled · User · template defaults
Registry file (.reg)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences]
"archivedelete"=dword:00000001
"archivegranularity"=dword:00000000
"archivemount"=dword:00000001
"archiveold"=dword:00000001
"archiveperiod"=dword:00000006
"deleteexpired"=dword:00000001
"doaging"=dword:00000001
"everydays"=dword:0000000E
"promptforaging"=dword:00000001
PowerShell
$ErrorActionPreference = 'Stop'
function Set-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $PropertyType,
[Parameter(Mandatory = $true)][object] $Value
)
if (-not (Test-Path -LiteralPath $Path)) {
New-Item -Path $Path -Force | Out-Null
}
New-ItemProperty -LiteralPath $Path -Name $Name -PropertyType $PropertyType -Value $Value -Force | Out-Null
}
function Remove-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (Test-Path -LiteralPath $Path) {
Remove-ItemProperty -LiteralPath $Path -Name $Name -Force -ErrorAction SilentlyContinue
}
}
function Clear-RegistryKeyValues {
param(
[Parameter(Mandatory = $true)][string] $Path
)
if (-not (Test-Path -LiteralPath $Path)) {
return
}
foreach ($propertyName in (Get-Item -LiteralPath $Path).Property) {
Remove-ItemProperty -LiteralPath $Path -Name $propertyName -Force -ErrorAction SilentlyContinue
}
}
# Policy: AutoArchive Settings
# Name: L_AutoArchiveSettings
# Scope: User
# State: Enabled
# Source: outlk16.admx
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'doaging' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'everydays' -PropertyType 'DWord' -Value 14
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'promptforaging' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'deleteexpired' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archiveold' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivemount' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archiveperiod' -PropertyType 'DWord' -Value 6
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivegranularity' -PropertyType 'DWord' -Value 0
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivedelete' -PropertyType 'DWord' -Value 1
- The OMA-URI is an inferred ADMX-backed Policy CSP candidate derived from the source ADMX file name and policy name.
- Some Microsoft policies use built-in Policy CSP pages whose area names don't match the ADMX file name, so verify the candidate against Microsoft Learn before deployment.
- The generated payload is incomplete because one or more ADMX element values were not supplied: L_TurnonAutoArchive, L_PromptbeforeAutoArchiveruns, L_Deleteexpireditemsemailfoldersonly, L_Archiveordeleteolditems, L_Showarchivefolderinfolderlist, L_Permanentlydeleteolditems
ADMX profile candidate (OMA-URI)
./User/Vendor/MSFT/Policy/Config/ADMX_outlk16/L_AutoArchiveSettingsIntune remediation scripts
Detection
$ErrorActionPreference = 'Stop'
$reasons = [System.Collections.Generic.List[string]]::new()
function Test-RegistryValueExists {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (-not (Test-Path -LiteralPath $Path)) {
return $false
}
return $null -ne (Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction SilentlyContinue)
}
function Test-RegistryValueEquals {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $Kind,
[Parameter(Mandatory = $true)][object] $Expected
)
if (-not (Test-Path -LiteralPath $Path)) {
return $false
}
$valueObject = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction SilentlyContinue
if ($null -eq $valueObject) {
return $false
}
$actual = $valueObject.$Name
switch ($Kind) {
'String' { return [string]$actual -ceq [string]$Expected }
'ExpandString' { return [string]$actual -ceq [string]$Expected }
'DWord' { return [uint32]$actual -eq [uint32]$Expected }
'QWord' { return [uint64]$actual -eq [uint64]$Expected }
'MultiString' {
$actualArray = @($actual)
$expectedArray = @($Expected)
if ($actualArray.Count -ne $expectedArray.Count) { return $false }
for ($index = 0; $index -lt $actualArray.Count; $index++) {
if ([string]$actualArray[$index] -cne [string]$expectedArray[$index]) { return $false }
}
return $true
}
'Binary' {
$actualArray = [byte[]]$actual
$expectedArray = [byte[]]$Expected
if ($actualArray.Length -ne $expectedArray.Length) { return $false }
for ($index = 0; $index -lt $actualArray.Length; $index++) {
if ($actualArray[$index] -ne $expectedArray[$index]) { return $false }
}
return $true
}
default { return [string]$actual -ceq [string]$Expected }
}
}
# Policy: AutoArchive Settings
# Name: L_AutoArchiveSettings
# Scope: User
# State: Enabled
# Source: outlk16.admx
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'doaging' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\doaging') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'everydays' -Kind 'DWord' -Expected 14
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\everydays') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'promptforaging' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\promptforaging') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'deleteexpired' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\deleteexpired') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archiveold' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\archiveold') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivemount' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\archivemount') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archiveperiod' -Kind 'DWord' -Expected 6
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\archiveperiod') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivegranularity' -Kind 'DWord' -Expected 0
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\archivegranularity') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivedelete' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences\archivedelete') | Out-Null
}
if ($reasons.Count -eq 0) {
Write-Output 'Compliant'
exit 0
}
$reasons | ForEach-Object { Write-Output $_ }
exit 1
Remediation
$ErrorActionPreference = 'Stop'
function Set-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $PropertyType,
[Parameter(Mandatory = $true)][object] $Value
)
if (-not (Test-Path -LiteralPath $Path)) {
New-Item -Path $Path -Force | Out-Null
}
New-ItemProperty -LiteralPath $Path -Name $Name -PropertyType $PropertyType -Value $Value -Force | Out-Null
}
function Remove-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (Test-Path -LiteralPath $Path) {
Remove-ItemProperty -LiteralPath $Path -Name $Name -Force -ErrorAction SilentlyContinue
}
}
function Clear-RegistryKeyValues {
param(
[Parameter(Mandatory = $true)][string] $Path
)
if (-not (Test-Path -LiteralPath $Path)) {
return
}
foreach ($propertyName in (Get-Item -LiteralPath $Path).Property) {
Remove-ItemProperty -LiteralPath $Path -Name $propertyName -Force -ErrorAction SilentlyContinue
}
}
# Policy: AutoArchive Settings
# Name: L_AutoArchiveSettings
# Scope: User
# State: Enabled
# Source: outlk16.admx
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'doaging' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'everydays' -PropertyType 'DWord' -Value 14
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'promptforaging' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'deleteexpired' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archiveold' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivemount' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archiveperiod' -PropertyType 'DWord' -Value 6
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivegranularity' -PropertyType 'DWord' -Value 0
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\outlook\preferences' -Name 'archivedelete' -PropertyType 'DWord' -Value 1
History 1 retained release
- 5568.100010 Aug 2026
- Already present in the first release ChangeIntel keeps.
Template
- Internal name
L_AutoArchiveSettings- Namespace
outlk16.Office.Microsoft.Policies.Windows- Template file
outlk16.admx- Release
- Microsoft 365 Apps 5568.1000 · file set
8be05d876aae137d…
Definition, editor controls and support
Definition
<policy class="User" displayName="$(string.L_AutoArchiveSettings)" explainText="$(string.L_IfthispolicyisenabledthenalltheoptionsintheAutoArchivedialog)" key="software\policies\microsoft\office\16.0\outlook\preferences" name="L_AutoArchiveSettings" presentation="$(presentation.L_AutoArchiveSettings)" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="outlk16.Office.Microsoft.Policies.Windows:L_AutoArchive" />
<supportedOn ref="Microsoft.Policies.Windows:SUPPORTED_Windows7" />
<elements>
<boolean id="L_TurnonAutoArchive" valueName="doaging">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<decimal id="L_RunAutoArchiveeveryxdays" maxValue="60" minValue="1" valueName="everydays" />
<boolean id="L_PromptbeforeAutoArchiveruns" valueName="promptforaging">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<boolean id="L_Deleteexpireditemsemailfoldersonly" valueName="deleteexpired">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<boolean id="L_Archiveordeleteolditems" valueName="archiveold">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<boolean id="L_Showarchivefolderinfolderlist" valueName="archivemount">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<decimal id="L_Cleanoutitemsolderthan" maxValue="60" minValue="1" valueName="archiveperiod" />
<enum id="L_empty19" valueName="archivegranularity">
<item displayName="$(string.L_Months)">
<value>
<decimal value="0" />
</value>
</item>
<item displayName="$(string.L_Weeks)">
<value>
<decimal value="1" />
</value>
</item>
<item displayName="$(string.L_Days)">
<value>
<decimal value="2" />
</value>
</item>
</enum>
<boolean id="L_Permanentlydeleteolditems" valueName="archivedelete">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
</elements>
</policy>Editor controls
<presentation id="L_AutoArchiveSettings" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<checkBox refId="L_TurnonAutoArchive">Turn on AutoArchive</checkBox>
<decimalTextBox defaultValue="14" refId="L_RunAutoArchiveeveryxdays" spinStep="0">Run AutoArchive every <x> days</decimalTextBox>
<checkBox refId="L_PromptbeforeAutoArchiveruns">Prompt before AutoArchive runs</checkBox>
<text>
</text>
<text>During AutoArchive:</text>
<checkBox refId="L_Deleteexpireditemsemailfoldersonly">Delete expired items (e-mail folders only)</checkBox>
<checkBox refId="L_Archiveordeleteolditems">Archive or delete old items</checkBox>
<checkBox refId="L_Showarchivefolderinfolderlist">Show archive folder in folder list</checkBox>
<decimalTextBox defaultValue="6" refId="L_Cleanoutitemsolderthan" spinStep="0">Clean out items older than</decimalTextBox>
<dropdownList defaultItem="0" noSort="true" refId="L_empty19">
</dropdownList>
<checkBox refId="L_Permanentlydeleteolditems">Permanently delete old items</checkBox>
</presentation>Supported platforms and category
outlk16.Office.Microsoft.Policies.Windows:category:L_AutoArchive
<category displayName="$(string.L_AutoArchive)" name="L_AutoArchive" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="outlk16.Office.Microsoft.Policies.Windows:L_Other" />
</category>
outlk16.Office.Microsoft.Policies.Windows:category:L_MicrosoftOfficeOutlook
<category displayName="$(string.L_MicrosoftOfficeOutlook)" name="L_MicrosoftOfficeOutlook" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions" />
outlk16.Office.Microsoft.Policies.Windows:category:L_Other
<category displayName="$(string.L_Other)" name="L_Other" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="outlk16.Office.Microsoft.Policies.Windows:L_OutlookOptions" />
</category>
outlk16.Office.Microsoft.Policies.Windows:category:L_OutlookOptions
<category displayName="$(string.L_OutlookOptions)" name="L_OutlookOptions" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="outlk16.Office.Microsoft.Policies.Windows:L_MicrosoftOfficeOutlook" />
</category>
outlk16.Office.Microsoft.Policies.Windows:unresolved:Microsoft.Policies.Windows:SUPPORTED_Windows7
<unresolved reference="Microsoft.Policies.Windows:SUPPORTED_Windows7" />
outlk16.Office.Microsoft.Policies.Windows:category:L_AutoArchive
<category displayName="$(string.L_AutoArchive)" name="L_AutoArchive" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="outlk16.Office.Microsoft.Policies.Windows:L_Other" />
</category>
<strings><string id="outlk16.Office.Microsoft.Policies.Windows:L_AutoArchive">AutoArchive</string></strings>
outlk16.Office.Microsoft.Policies.Windows:category:L_MicrosoftOfficeOutlook
<category displayName="$(string.L_MicrosoftOfficeOutlook)" name="L_MicrosoftOfficeOutlook" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions" />
<strings><string id="outlk16.Office.Microsoft.Policies.Windows:L_MicrosoftOfficeOutlook">Microsoft Outlook 2016</string></strings>
outlk16.Office.Microsoft.Policies.Windows:category:L_Other
<category displayName="$(string.L_Other)" name="L_Other" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="outlk16.Office.Microsoft.Policies.Windows:L_OutlookOptions" />
</category>
<strings><string id="outlk16.Office.Microsoft.Policies.Windows:L_Other">Other</string></strings>
outlk16.Office.Microsoft.Policies.Windows:category:L_OutlookOptions
<category displayName="$(string.L_OutlookOptions)" name="L_OutlookOptions" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="outlk16.Office.Microsoft.Policies.Windows:L_MicrosoftOfficeOutlook" />
</category>
<strings><string id="outlk16.Office.Microsoft.Policies.Windows:L_OutlookOptions">Outlook Options</string></strings>