Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

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

June 8, 2023 ExchangeMicrosoft 365Outlook

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 did 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 v2 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 365, 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
3
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

PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

October 15, 2023

Configure Email Forwarding for Mailbox on Exchange Server/Microsoft...

September 14, 2023

Disable Welcome Message for Microsoft 365 Groups

August 28, 2023

Configuring Azure AD Password Policy

July 12, 2023

Find Inactive (Unused) Distribution Lists in Exchange/Microsoft 365

June 26, 2023

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

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

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Outlook Keeps Asking for Password on Windows
  • FAQ: Licensing Microsoft Exchange Server 2019/2016
  • Whitelist Domains and Email Addresses on Exchange Server and Microsoft 365
  • Moving Exchange Mailboxes to Different Database
  • How to Cleanup, Truncate or Move Log Files in Exchange Server 2013/2016/2019?
  • Search and Delete Emails from User Mailboxes on Exchange Server (Microsoft 365) with PowerShell
  • Fix: Microsoft Outlook Search Not Working on Windows 10/11
Footer Logo

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


Back To Top