Key takeaway: Classic Outlook for Windows from 2016 onward (Outlook 2016, 2019, 2021, 2024, and Microsoft 365 Apps) shares one registry hive, 16.0, so a single set of settings covers all of them. You can deliver those settings with Group Policy Preferences (scoped to an AD site), a PowerShell script, Intune, or Configuration Manager. The settings control which Autodiscover methods Outlook tries and in what order, which is how you steer desktops to a new Exchange or Exchange Online entry point. Test with a pilot group first, because the wrong value can stop Outlook from finding the mailbox at all.

When a mailbox moves to Exchange Online, a server is replaced, or a namespace changes, the mailbox is not the problem. The desktops are. Outlook remembers where it found Autodiscover last time, and domain-joined machines ask Active Directory first. This guide shows how to find out what your desktops are doing, how to change it for every machine in a site, and how to clean up the ones that do not follow.

What This Covers and What It Does Not

ClientCovered here?Notes
Outlook 2016, 2019, 2021, 2024 (MSI or Click-to-Run)YesAll use the 16.0 registry hive. Outlook 2016 and 2019 reached end of support in October 2025, so plan upgrades
Outlook in Microsoft 365 AppsYesSame 16.0 hive
Outlook 2013 and earlierNoUses 15.0 and earlier hives and is out of support
New Outlook for WindowsNoConfigured through the cloud account and Microsoft 365 or Intune policy, not these registry values
Outlook for Mac, iOS, AndroidNoManaged through MDM and their own settings
Outlook on the webNoNothing to push

How Outlook Finds Its Mailbox

When Outlook starts, or when it is told its connection needs refreshing, it uses Autodiscover to learn the mailbox server, the sign-in method, and the URLs for features such as free/busy. According to Microsoft, Outlook can try these methods, in roughly this order depending on topology:

  1. SCP lookup. Domain-joined computers query Active Directory for a Service Connection Point published by Exchange.
  2. HTTPS root domain query, such as https://contoso.com/autodiscover/autodiscover.xml.
  3. HTTPS Autodiscover domain query, such as https://autodiscover.contoso.com/autodiscover/autodiscover.xml.
  4. Local XML file, if configured.
  5. HTTP redirect method.
  6. SRV record query.
  7. Cached URL from the Outlook profile, used by Outlook 2010 14.0.7140.5001 and later.
  8. Direct connect to Microsoft 365, used by Outlook 2016 16.0.6741.2017 and later.

This explains the common symptoms after a migration. A domain-joined PC still finds the old on-premises SCP first, gets an answer from the wrong server, and either shows certificate warnings, prompts for credentials, or connects to the old server. A PC outside the domain skips the SCP and works fine. Fixing that difference is the whole job.

Fix the Source First, Then the Desktops

Registry changes on desktops are the second step. First make sure the sources of truth are right, or you will be masking a problem.

Get-ClientAccessService | Format-List Name, AutoDiscoverServiceInternalUri Set-ClientAccessService -Identity EX01 ` -AutoDiscoverServiceInternalUri "https://autodiscover.contoso.com/Autodiscover/Autodiscover.xml"

If you have fully moved to Exchange Online and are retiring Exchange, the SCP objects of the old servers must not keep pointing at servers that are gone. Removing an Exchange server correctly removes its SCP. If you keep a management server, make sure its SCP is not advertised to clients, or use the policy in Step 2 to make desktops ignore it.

Step 1: See What Your Desktops Are Doing Now

Find out which Autodiscover values already exist on your machines. A leftover value from an old migration is a classic cause of "it works for everyone but these PCs." Microsoft's guidance is to check both of these subkeys:

The values that may be present are all DWORDs: PreferLocalXML, PreferProvidedEmailInAutoDiscoverAuthPrompts, ExcludeHttpRedirect, ExcludeHttpsAutoDiscoverDomain, ExcludeHttpsRootDomain, ExcludeScpLookup, ExcludeSrvRecord, ExcludeLastKnownGoodURL, and ExcludeExplicitO365Endpoint. A value of 1 excludes that method. A value of 0 or absent means Outlook uses it.

A note on names: some blogs and vendor guides refer to a value called ExcludeSrvLookup. Microsoft says that value does not exist in Outlook. Only ExcludeSrvRecord controls the SRV lookup. If you find ExcludeSrvLookup on a machine, it does nothing.

Run this to report the current state on a computer (for the logged-on user):

$paths = 'HKCU:\Software\Microsoft\Office\16.0\Outlook\AutoDiscover', 'HKCU:\Software\Policies\Microsoft\Office\16.0\Outlook\AutoDiscover' foreach ($p in $paths) { Write-Host "== $p" if (Test-Path $p) { Get-ItemProperty $p | Select-Object * -ExcludeProperty PS* | Format-List } else { Write-Host "(not present)" } }

For a fleet, run the same check through your remote execution tool or an Intune remediation detection script and collect the output into a CSV.

Step 2: Decide Which Settings You Need

Your situationSettings to pushWhy
Fully moved to Exchange Online; Exchange removed or being removedExcludeScpLookup = 1; also ExcludeHttpsRootDomain = 1Stops domain-joined PCs asking AD for an SCP that points at old servers. Skipping the root-domain query avoids a slow query against your public website
Hybrid; most users still on-premisesUsually nothing. Keep the SCP correct. Optionally ExcludeExplicitO365Endpoint = 1Prevents the direct-connect-to-Microsoft-365 step from prompting on-premises mailbox users for a Microsoft 365 sign-in when your domain is Microsoft 365-enabled
Hybrid; Autodiscover prompts for Microsoft 365 sign-in on every startCheck ExcludeExplicitO365Endpoint, and see "Sign-in behavior" belowOften a mismatch between where DNS points and where the mailbox lives
On-premises only, new namespaceFix the SCP and DNS. For machines that cannot use them, add the redirect value (below)Gives Outlook an explicit URL for the domain
Stale values left from a previous projectRemove them (set to 0 or delete)Old exclusions can block the method you now want
New desktops that should create their profile automaticallyZeroConfigExchange = 1 (see "Profile creation")Outlook sets up the account from Autodiscover without prompting

Two warnings. Excluding a method that your environment relies on will stop Outlook from finding the mailbox. Do not turn off methods "to be safe." Also, the policy path (Software\Policies) is the right place for values you want users unable to change. Write there when you manage the setting centrally.

Redirecting a Domain to a Specific Autodiscover URL

If you need Outlook to use an explicit URL for a mail domain, add a string value under the AutoDiscover key. The value *name* is the domain and the value *data* is the URL:

Name: contoso.com Type: REG_SZ Data: https://autodiscover.contoso.com/autodiscover/autodiscover.xml

Use this sparingly. It overrides discovery, so when the URL changes again you must push the new value.

Method 1: Group Policy (Best for Domain-Joined Desktops in a Site)

Group Policy Preferences can write registry values reliably across all Outlook versions, and they can be scoped to an Active Directory site.

1a. Prepare the Group Policy Object

  1. Open Group Policy Management. Create a new GPO named Outlook - Autodiscover - <Site name>.
  2. Link it to the site if you want it to apply to every computer and user in that AD site: expand Sites in the console (if it is empty, right-click Sites and choose Show Sites), right-click the site, and choose Link an Existing GPO. Alternatively, link it to the OU that holds the users and use item-level targeting (below).
  3. User settings apply to the user, so make sure the User Configuration section is enabled and security filtering includes the users (Authenticated Users by default).

1b. Add the Registry Preferences

  1. Edit the GPO. Go to User Configuration, Preferences, Windows Settings, Registry.
  2. Right-click, choose New, Registry Item, and set:
FieldValue
ActionUpdate
HiveHKEY_CURRENT_USER
Key PathSoftware\Policies\Microsoft\Office\16.0\Outlook\AutoDiscover
Value nameExcludeScpLookup
Value typeREG_DWORD
Value data1 (Decimal)
  1. Repeat for each value you chose in Step 2.
  2. To remove a stale value, use the Delete action on the same key and value name.

1c. Limit It to the Right Machines and Versions (Item-Level Targeting)

On the Common tab of each registry item, select Item-level targeting, then Targeting, and add:

Because Outlook 2016, 2019, 2021, 2024, and Microsoft 365 Apps all use 16.0, you do not need a separate item per version.

1d. Apply and Verify

gpupdate /force gpresult /r /scope user reg query "HKCU\Software\Policies\Microsoft\Office\16.0\Outlook\AutoDiscover"

Close and reopen Outlook. The values are read when Outlook starts, so a running session does not change behavior until it restarts.

About the Office Administrative Templates

Microsoft publishes one download of ADMX/ADML files for Microsoft 365 Apps, Office 2019, 2021, and 2024. Copy them to your central store (\\yourdomain\SYSVOL\yourdomain\Policies\PolicyDefinitions) to manage many Outlook and Office settings with the normal policy editor. Do not assume the Autodiscover exclusion values appear as dedicated settings in every version of the templates. Writing the registry values with Group Policy Preferences, as above, works regardless.

Method 2: PowerShell Script

Use a script when the machines are not all domain-joined, when you need to run it through a deployment tool, or when you want to change values for users who are not logged on.

2a. Per-User Script (Runs as the Signed-In User)

This is the simplest form, suitable for a logon script or an Intune script set to run in the user context:

$key = 'HKCU:\Software\Policies\Microsoft\Office\16.0\Outlook\AutoDiscover' New-Item -Path $key -Force | Out-Null New-ItemProperty -Path $key -Name ExcludeScpLookup -Value 1 -PropertyType DWord -Force | Out-Null New-ItemProperty -Path $key -Name ExcludeHttpsRootDomain -Value 1 -PropertyType DWord -Force | Out-Null

2b. Machine-Wide Script (Runs as Administrator or SYSTEM)

This version applies to every profile on the computer: users currently signed in, users who are not signed in, and the default profile that new users copy. Test it with -WhatIf first.

[CmdletBinding(SupportsShouldProcess)] param( [hashtable]$Values = @{ ExcludeScpLookup = 1; ExcludeHttpsRootDomain = 1 }, [switch]$Remove, [string]$OfficeVersion = '16.0' ) $sub = "Software\Policies\Microsoft\Office\$OfficeVersion\Outlook\AutoDiscover" function Set-Hive([string]$root) { $path = "Registry::$root\$sub" foreach ($name in $Values.Keys) { if ($Remove) { if ($PSCmdlet.ShouldProcess("$path\$name", 'Remove')) { Remove-ItemProperty -Path $path -Name $name -ErrorAction SilentlyContinue } } else { if ($PSCmdlet.ShouldProcess("$path\$name", "Set to $($Values[$name])")) { if (-not (Test-Path $path)) { New-Item -Path $path -Force | Out-Null } New-ItemProperty -Path $path -Name $name -Value $Values[$name] -PropertyType DWord -Force | Out-Null } } } } # 1. Users who are signed in (hives already loaded) Get-ChildItem Registry::HKEY_USERS | Where-Object { $_.PSChildName -match '^S-1-5-21-[\d-]+$' } | ForEach-Object { Set-Hive $_.Name } # 2. Users who are not signed in, plus the Default profile (load each hive, then unload) $offline = @(Get-CimInstance Win32_UserProfile | Where-Object { -not $_.Special -and -not $_.Loaded } | ForEach-Object { Join-Path $_.LocalPath 'NTUSER.DAT' }) $offline += 'C:\Users\Default\NTUSER.DAT' foreach ($dat in $offline) { if (-not (Test-Path $dat)) { continue } reg load HKU\TempOutlook "$dat" | Out-Null try { Set-Hive 'HKEY_USERS\TempOutlook' } finally { [gc]::Collect(); Start-Sleep -Milliseconds 300; reg unload HKU\TempOutlook | Out-Null } }

To pass your own values, call it like .\Set-OutlookAutodiscover.ps1 -Values @{ExcludeScpLookup=1}. To undo, run it again with -Remove and the same names.

2c. Run It Against Many Computers

$computers = Get-Content C:\Migration\outlook-pilot.txt Invoke-Command -ComputerName $computers -FilePath .\Set-OutlookAutodiscover.ps1

This requires PowerShell remoting to be allowed. For machines you cannot reach this way, use a deployment tool.

Method 3: Intune and Cloud Management

Method 4: Configuration Manager and Other Tools

In Configuration Manager, create a Configuration Item with a registry value setting for the current user, set it to be remediated, and add it to a baseline targeted at a collection. Any endpoint management tool that can run PowerShell or set a registry value in a user context can apply the same values.

Profile Creation and Sign-In Behavior

Autodiscover settings affect what Outlook finds. Sometimes the existing profile also needs to be refreshed, or the sign-in needs help.

Refreshing a Stuck Profile

  1. Delete cached Autodiscover files so Outlook asks again. They are in %LOCALAPPDATA%\Microsoft\Outlook and have names ending in Autodiscover.xml. Close Outlook first.
Get-ChildItem "$env:LOCALAPPDATA\Microsoft\Outlook" -Filter '*Autodiscover*.xml' | Remove-Item -Force
  1. If the profile still points to the old server, create a new profile (Control Panel, Mail, Show Profiles, Add). Outlook then runs Autodiscover from scratch and picks the new settings. You can also enable first-run auto-configuration for new profiles by setting ZeroConfigExchange to 1 under the AutoDiscover key. Test this on a pilot machine first, as behavior depends on how your accounts are set up.
  2. If the mailbox was moved, restart Outlook. A moved mailbox normally prompts a restart on its own once Autodiscover answers correctly.

Sign-In Behavior

cmdkey /list | Select-String 'MicrosoftOffice16'

Verify on a Pilot Machine

  1. Check the registry. Run the audit script from Step 1 and confirm the values are present in the Policies path.
  2. Run Outlook's own test. Hold Ctrl, right-click the Outlook icon in the notification area, and choose Test E-mail AutoConfiguration. Confirm the email address, clear Use Guessmart and Secure Guessmart Authentication, and select Test. The Log tab lists every method Outlook tried, including the ones your settings excluded, and the Results tab shows the final URLs.
  3. Check where Outlook is connected. Hold Ctrl, right-click the icon, and choose Connection Status. The server name should be the Exchange Online or new on-premises endpoint.
  4. Run it twice. Once on a domain-joined computer inside the site and once on one outside, to confirm both paths.
  5. Check for prompts. Start Outlook cold (after a reboot) and look for credential or certificate prompts.

Roll Out in Rings

  1. Pilot (5 to 10 users across Outlook versions). Run for several days.
  2. One site using a site-scoped GPO or targeting.
  3. Remaining sites, one at a time, with a rollback plan ready.
  4. Rollback. Keep the removal version of the script (-Remove) or switch the GPP item action to Delete. Tell the helpdesk what changed and how to test (see "Verify on a Pilot Machine").
  5. Document the settings in your change record. Autodiscover exclusions are easy to forget, and they cause confusing problems years later, so add a reminder to review them when the environment changes again.

Troubleshooting

SymptomLikely cause
Domain PCs connect to the old server, others workThe SCP in AD still points at the old server. Fix it or set ExcludeScpLookup = 1
Outlook shows "The connection to Microsoft Exchange is unavailable" after a migrationAutodiscover cannot return the new settings. Check DNS and the Test E-mail AutoConfiguration log
Outlook never finds the mailbox after you set exclusionsYou excluded the method your environment relies on. Remove the values and retest
Values are set but nothing changedOutlook was not restarted, the GPO is not applying (check gpresult), or the policy was written under the wrong Office version number
Certificate warning on first startAutodiscover reaches a server with a name-mismatched certificate. See the Exchange certificate guide
Microsoft 365 sign-in window appears for on-premises mailboxesThe direct connect to Microsoft 365 step is being tried. Consider ExcludeExplicitO365Endpoint = 1
One user is wrong while the site is rightStale per-user values or a cached XML file. Run the audit script and clear the cache
Setting ExcludeSrvLookup has no effectThat value is not used by Outlook. Use ExcludeSrvRecord
It works for Outlook 2016 but not for new OutlookNew Outlook is configured differently and ignores these registry values

Checklist

If you would like help with an Exchange Online cutover, a hybrid Autodiscover problem, or a desktop rollout across several sites, get in touch.

Outlook Autodiscover Group Policy PowerShell Intune Exchange Online Microsoft 365 Apps