This small batch script applies a few Outlook/Exchange registry values that can help stop repeated credential prompts in on-premises Exchange environments.
It sets these values for the current user:
- Forces modern auth for Exchange autodiscover
- Excludes the explicit Microsoft 365 autodiscover endpoint
- Disables Outlook's credential prompt policy value
- Closes Outlook so the change can take effect cleanly
@echo off
setlocal
echo Applying Outlook / Exchange registry fixes...
reg add "HKCU\Software\Microsoft\Exchange" /v AlwaysUseMSOAuthForAutoDiscover /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover" /v ExcludeExplicitO365Endpoint /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Policies\Microsoft\Office\16.0\Outlook\Security" /v PromptForCredentials /t REG_DWORD /d 0 /f
echo Closing Outlook...
taskkill /f /im outlook.exe >nul 2>&1
echo Done.
endlocalreg add "HKCU\Software\Microsoft\Exchange" /v AlwaysUseMSOAuthForAutoDiscover /t REG_DWORD /d 1 /f && reg add "HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover" /v ExcludeExplicitO365Endpoint /t REG_DWORD /d 1 /f && reg add "HKCU\Software\Policies\Microsoft\Office\16.0\Outlook\Security" /v PromptForCredentials /t REG_DWORD /d 0 /f && taskkill /f /im outlook.exe >nul 2>&1- Intended for Outlook 2016 / 2019 / Microsoft 365 Apps using the
16.0registry path. - Applies to the current user only (
HKCU). - If your environment enforces these settings via Group Policy, those policies may override manual changes.
- Restart Outlook after running the script.
reg delete "HKCU\Software\Microsoft\Exchange" /v AlwaysUseMSOAuthForAutoDiscover /f
reg delete "HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover" /v ExcludeExplicitO365Endpoint /f
reg delete "HKCU\Software\Policies\Microsoft\Office\16.0\Outlook\Security" /v PromptForCredentials /fUse this only if you understand how your Outlook authentication and autodiscover flow is configured. In some environments, credential prompts are caused by server-side auth, autodiscover, certificate, or policy issues rather than local client settings.