Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Azure and Microsoft 365 / How to Manually Configure Exchange or Microsoft 365 Account in Outlook 365/2019/2016

March 17, 2024 Azure and Microsoft 365ExchangeMicrosoft Office

How to Manually Configure Exchange or Microsoft 365 Account in Outlook 365/2019/2016

Modern versions of Outlook (starting with Outlook 2016) don’t allow you to manually configure a connection to a mailbox hosted on Exchange Server or Exchange Online (Microsoft 365). Microsoft developers believe that Outlook should always use the Autodiscover mechanism to automatically discover the connection settings for an Exchange mailbox.

In this article, we’ll show you how to manually set up a connection in Outlook 2019/2016 or Outlook 365 to a mailbox on an on-premises Exchange Server or Microsoft 365 (Office 365 or Exchange Online) using a local XML file that contains the necessary connection information. This method will help you configure Outlook connection to the mailbox if autodiscovery cannot be performed (Autodiscover is not configured correctly, the Autodiscover.xml file is not available, Internet access is limited, a proxy or VPN connection is used to access the internal Exchange Server, etc.) .

Note. Of course, first of all, we recommend that you correctly configure Autodiscover for your domain both for external and internal clients. You should use this guide to manually set up an Outlook connection only if you can’t configure Autodiscover properly.

Contents:
  • Method 1. Local XML Redirect for Outlook Client
  • Method 2. Local Autodiscover.XML File with Exchange Connection Settings
  • Method 3. Autodiscover.XML File Example for Microsoft 365 (Exchange Online)

Method 1. Local XML Redirect for Outlook Client

  1. If you know the URL to access your Exchange through OWA, check if the following URL address is available: _https://mail.woshub.com/autodiscover/autodiscover.xml (you must authenticate to access the XML file). If the file is available, go to the next step. If not, go to the second method; try to open autodiscover.xml on exchange
  2. Create a custom XML file on the local disk of your computer that will redirect Outlook to the URL with the file autodiscover.xml. Create a text file autodiscover.xml containing the following text and save it to the local directory on your computer (for example, C:\Autodiscover\autodiscover.xml);
    <?xml version=”1.0″ encoding=”utf-8″ ?>
    <Autodiscover xmlns=”http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006″>
    <Response xmlns=”http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a”>
    <Account>
    <AccountType>email</AccountType>
    <Action>redirectUrl</Action>
    <RedirectUrl>_https://mail.woshub.com/autodiscover/autodiscover.xml</RedirectUrl>
    </Account>
    </Response>
    </Autodiscover>

    Note. Replace the value in the RedirectUrl parameter with the Autodiscover URL for your domain.
  3. Open the Registry Editor and go to the reg key HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\16.0\Outlook\AutoDiscover. Create a new REG_SZ registry parameter with the name of your domain and the value containing the path to the local XML file you created in the previous step. For example:
    Parameter name: woshub.com
    Value: C:\Autodiscover\autodiscover.xml
    Then create a PreferLocalXML (REG_DWORD) parameter with a value of 1. After that, Outlook will always look at your local autodiscover.xml file first when performing autodiscovery;
    preferlocalxml registry option for outlook 2019/2016
  4. Just start Outlook and run the Add Account wizard. Enter your mailbox name, email address, and password. If you do everything correctly, Outlook will automatically configure the Exchange mailbox connection. manually configure Exchange account in Outlook 2016

Method 2. Local Autodiscover.XML File with Exchange Connection Settings

If the URL with autodiscover.xml is not available from your computer, you will have to manually create a local XML file containing full user settings to connect to the Exchange Server or Microsoft 365 mailbox. You can get sample parameters for this file from any configured Outlook client. To do it, go to the folder C:\Users\%username%\AppData\Local\Microsoft\Outlook, where you will find the file with the name [longGUID]-Autodiscover.xml.

outlook profie autodiscover.xml example

Copy this file, change the account settings if necessary, and save it to the C:\Autodiscover\autodiscover.xml. Then follow steps 3 and 4 from the first method.

If you cannot get this file, you can create it manually. The file must have the following format.

If you are using Outlook Anywhere (RPC/HTTP)

<?xml version=”1.0″ encoding=”utf-8″?>
<Autodiscover xmlns=”http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006″>
<Response xmlns=”http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a”>
<User>
<AutoDiscoverSMTPAddress>[SMTP_ADDRESS]</AutoDiscoverSMTPAddress>
<LegacyDN>[USER_LEGACYDN]</LegacyDN>
</User>
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>
<Protocol>
<Type>EXCH</Type>
<Server>[SERVER_NAME]</Server>
<ServerDN>[SERVER_DN]</ServerDN>
<AuthPackage>[RPC_AUTH_PACKAGE]</AuthPackage>
</Protocol>
<Protocol>
<Type>EXPR</Type>
<Server>[OUTLOOK_ANYWHERE_SERVER]</Server>
<SSL>On</SSL>
<AuthPackage>[HTTP_AUTH_PACKAGE]</AuthPackage>
<ServerExclusiveConnect>on</ServerExclusiveConnect>
<CertPrincipalName>[CERTIFICATE_PRINCIPAL_NAME]</CertPrincipalName>
<ServerExclusiveConnect>off</ServerExclusiveConnect>
</Protocol>
</Account>
</Response>
</Autodiscover>

If you connect without Outlook Anywhere:

<?xml version=”1.0″ encoding=”utf-8″?>
<Autodiscover xmlns=”http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006″>
<Response xmlns=”http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a”>
<User>
<AutoDiscoverSMTPAddress>[SMTP_ADDRESS]</AutoDiscoverSMTPAddress>
<LegacyDN>[USER_LEGACYDN]</LegacyDN>
</User>
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>
<Protocol>
<Type>EXCH</Type>
<Server>[SERVER_NAME]</Server>
<ServerDN>[SERVER_DN]</ServerDN>
<AuthPackage>[RPC_AUTH_PACKAGE]</AuthPackage>
</Protocol>
</Account>
</Response>
</Autodiscover>

Change the parameters in square brackets in these XML files to the information that matches your domain (you can get it from your Exchange or AD administrator).

Method 3. Autodiscover.XML File Example for Microsoft 365 (Exchange Online)

If you want to manually connect a mailbox from Microsoft 365 (Exchange Online) in Outlook 365/2019/2016, you can get all the required mailbox settings for the local autodiscover.xml file using PowerShell.

Connect to your EOL tenant using the Exchange Online PowerShell v3 module:

Connect-ExchangeOnline -UserPrincipalName [email protected] -ShowProgress $true

Get the user mailbox settings with the command:

Get-Mailbox -Identity maxbak | select DisplayName,LegacyExchangeDN,PrimarySmtpAddress,ExchangeGuid|fl

get exchange mailbox properties using powershell

The following is an example of an Autodiscover.xml file for the Exchange Online (Microsoft 365) mailbox. Replace the highlighted parameters with the attribute values you got using PowerShell:

<?xml version="1.0" encoding="utf-8"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
<User>
<DisplayName> [DisplayName] </DisplayName>
<LegacyDN>[LegacyExchangeDN] </LegacyDN>
<AutoDiscoverSMTPAddress>[PrimarySmtpAddress] </AutoDiscoverSMTPAddress>
<DeploymentId>1234</DeploymentId>
</User>
<Account>
<AccountType>email</AccountType>
<Action>settings</Action>
<MicrosoftOnline>True</MicrosoftOnline>
<ConsumerMailbox>False</ConsumerMailbox>
<Protocol Type="mapiHttp" Version="1">
<MailStore>
<ExternalUrl>https://outlook.office365.com/mapi/emsmdb/?MailboxId=[ExchangeGuid]@woshub.com</ExternalUrl>
</MailStore>
<AddressBook>
<ExternalUrl>https://outlook.office365.com/mapi/nspi/?MailboxId=[ExchangeGuid]@woshub.com</ExternalUrl>
</AddressBook>
</Protocol>
<Protocol>
<Type>WEB</Type>
<Internal>
<OWAUrl AuthenticationMethod="LiveIdFba, OAuth">https://outlook.office365.com/owa/</OWAUrl>
<Protocol>
<Type>EXCH</Type>
<ASUrl>https://outlook.office365.com/EWS/Exchange.asmx</ASUrl>
</Protocol>
</Internal>
<External>
<OWAUrl AuthenticationMethod="Fba">https://outlook.office365.com/owa/woshub.com/</OWAUrl>
<Protocol>
<Type>EXPR</Type>
<ASUrl>https://outlook.office365.com/EWS/Exchange.asmx</ASUrl>
</Protocol>
</External>
</Protocol>
<Protocol>
<Type>EXHTTP</Type>
<Server>outlook.office365.com</Server>
<SSL>On</SSL>
<AuthPackage>Basic</AuthPackage>
<ServerExclusiveConnect>On</ServerExclusiveConnect>
</Protocol>
</Account>
</Response>
</Autodiscover>

local autodoscover.xml file example

Save the file as C:\Autodiscover\autodiscover.xm. Then make changes to the registry as described in Method 1 -> Step 3 and 4. Restart Outlook after adding a new user account.

The first time you open it, you should see the Microsoft 365 Modern Authentication prompt. Enter your username and password. If the user is enabled for MFA in Microsoft 36, confirm sign-in with the second factor.

If a blank Office 365 sign-in window appears when you start Outlook, you can fix this issue by following this guide.

modern microsoft 365 sign-in prompt in outlook

Your Outlook should connect to the Exchange mailbox, and you will see a list of mailbox folders and e-mail items.

7 comments
6
Facebook Twitter Google + Pinterest
previous post
Fix: Saved RDP Credentials Didn’t Work on Windows
next post
How to Create a Self-Signed Certificate on Windows

Related Reading

Remove ‘Your License isn’t Genuine’ Banner in MS...

April 21, 2025

Hardware Graphics Acceleration Causes Visual Glitches in Microsoft...

December 23, 2024

Rollback Microsoft Office to an Earlier Version After...

December 10, 2024

Mapping SharePoint Online Library as Network Drive in...

July 15, 2024

Automatic Outlook User Profile Configuration with ZeroConfigExchange

May 21, 2024

7 comments

Frank December 12, 2018 - 5:48 pm

I tried this and it worked except I can’t open Outlook, I get the error “nnot start microsoft outlook. the set of folders cannot be opened. the attempt to log on to the server has failed”

Any idea?

Reply
admin December 20, 2018 - 9:50 am

What version of Exchange do you use? Is your mailbox available over OWA?
Try to create a new clean Outlook configuration.

Reply
Cid September 25, 2019 - 3:51 pm

Thank you very much. I work in remote through VPN and the Exchange server 2013 is not published on Internet, so the only way is to configure manually. With Outlook 2013 there weren’t problems but with Outlook 2016 was impossible until I find your article.

Thanks!

Reply
BAKEMONO July 19, 2020 - 11:42 am

Outlook 2016 \ Exchange 2010.

Is there a way to add an additional account of a generic mailbox with PowerShell, in an outlook already configured for a domain user? because I always have to go through [File], [Account Settings], [Account Settings], in the [Messaging] tab [Edit] button, [Additional settings], [Advanced] tab, [Add] …

Reply
admin July 28, 2020 - 3:34 am

You can use an Outlook Profile (PRF) file to modify existing Outlook profiles.
And then import this prf file into user’s Outlook configuration:
outlook.exe /importprf \\server1\share\outlook.prf

Reply
Mene October 30, 2020 - 3:37 pm

Thanks a lot, this worked perfectly fine with Outlook 2016. After hours of searching finally some easy fix.

Reply
Cheru January 11, 2022 - 2:03 pm

Thanks a lot our Dear BOOS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
It’s working perfectly in Outlook 2016 on Exchange 2016

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMware
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Outlook Keeps Asking for Password on Windows
  • Checking User Sign-in Logs in Entra ID (Microsoft 365)
  • Search and Delete Emails from User Mailboxes on Exchange Server (Microsoft 365) with PowerShell
  • Fix: Microsoft Outlook Search Not Working on Windows 10/11
  • Blank Sign-in Screen in Office 365 Apps (Outlook, Teams, etc.)
  • Removing Built-in Teams Chat in Windows 11
  • How to Install Microsoft Teams Client on Linux
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top