Enable Office 365 Auto-discover for Outlook in SBS 2011 Exchange Environments

One of the  issues you will run into when migrating from an on premises Exchange 2010 server on SBS 2011 is that Outlook will not autodiscover the correct Office 365 server settings. Fortunately this can be easily solved with a few simple PowerShell commands.

  1. Open an Exchange Management Shell as an administrator. (Elevated PowerShell)
  2. Use the following command to discover the Identity name of your Autodiscover Virtual Directory. Either note or copy the values in the Identity field.
    [highlight]Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, Identity[/highlight]
    Retrieve Exchange Autodiscover Virtual Directory Settings - SBS 2011
  3. Use the following command to remove the AutoDiscover Virtual Directory. Be sure to replace the text inside the quotes with the value in the Identity field above.
    [highlight]Remove-AutodiscoverVirtualDirectory –Identity “Insert identity value here”[/highlight]
     Virtual Directory for Exchange 2010
  4. You will have to confirm the removal by hitting Y for yes when prompted. You can double check to see if this worked properly by rerunning the command in step 2.  You should get a blank result if successful.

That should be it. Your Outlook clients should connect successfully to the Office 365 service.

Hat Tip to mcbsys.com for pointing me in the right direction.

Join the Conversation

37 Comments

      1. How do I re-add this after removing it, seems to have broken my migration link with office 365

        1. Did you ever find a way to get your migration link working? I am in the same situation.

          Thanks!

  1. Absolutely awesome! I’ve been looking for this for 3 months. We do lots of these migrations and have needed this. Thanks again!

  2. I just wanted to say thank you, we have run into this problem with sbs2011 a number of times and spent hours on the phone with microsoft. They never had a fix for us and your solution worked across the board. Thank you again. If your ever in San Antonio, TX i owe you a drink

  3. I as well have been looking for this solution, but It is not working for me. I am getting object can not be found errors when I put in the identity.

    1. the error is:
      The opperation couldn’t be preformed because object ‘EFM-SERVER\Autodicover ‘ Couldn’t be found on ‘EFM-SERVER.marburger.local’.

      I read that others have the same issue, and some fixed it by reinstalling exchange.

      1. Hi Peter,

        The only thing I’m noticing is that you misspelled Autodiscover. Was that just a misspelling on the comment, or was it misspelled in the powershell command?

          1. i know its obselete by now but for the future use
            New-AutodiscoverVirtualDirectory -WebSiteName “Default Web Site”

            dis recreated the entry without any url which you aint need anyway. autodiscover dont need urls

  4. This was great. I lost a bunch of time looking everywhere going crazy before I found this. Thank you!

  5. Your command broke powershell commands, thanks for not including it in your how to…

    BEWARE do not run these commands if you still need to use EMS.

  6. Not sure if Peter ever found his answer but when I ran into that make sure you have the Identity in quotes: “\Autodiscover (Default Web Site)”
    That fixed it for me easily.

    1. Not sure why but the was removed from my last post. Should look like this:
      Remove-AutodiscoverVirtualDirectory –Identity “SRV\Autodiscover (Default Web Site)”

      Thank you BTW Kirby, this worked great.

  7. Kirby,
    Came accross this article the other week and have applied the script. However, my Outlook clients still connect to SBS 2011 Exchange. In the AD under Sites and services the Exchange Administrative Group still has the Autodiscover entry in the Server containter which has the binding to the local Exchange.
    Does this container need to be deleted?
    When I went back to EMC to restore the Autodiscover VM it now doesn’t have the option for this VM listed. Not really a problem I guess because somehow Outlook still finds the server.
    Am I missing something?
    Tried a number of times with Wipro from Office365 but they don’t seem to understand the problem.
    Appreciate any guidance
    G

  8. Hi I have applied this to the sbs2011 server and the original check for the setting comes up blank but mail32bit outlook 2016 is still finding the on premise exchange.
    1. do I have to reboot the server as well?
    2. disable the on premise exchange?

  9. To undo in case you need to sync again use
    New-AutodiscoverVirtualDirectory -WebSiteName “Default Web Site”

    Deleting the entry enables your outlookclient to connets to office 365 but also break sync functionality from premise to office365

  10. Worked like a charm for my SBS 2011 migration. There are so many different articles out there to fix it, but this one did the trick and undoing it seems simple enough it it did break anything. Thanks!

  11. I’ve searched a long time for this command. Works great und helped me a lot.
    Thanks and best wishes
    Marcus

  12. I went a different route for my setup that works much easier than the above. Go to IIS and stop the Autodiscover App pool. Then go to services and stop the Exchange active directory topology.

    Then disable just disable it, the outlook clients will connect to 365 using autodiscover.

    1. I like this idea – it’s more reversible if there’s a problem – just about to give it a try!

  13. Thanks, very helpfull, just migrating a customer to 365, so hope everything works for me on monday when they arrive in the office. It works on my test VM on their internal network.

  14. It works but I have an issue.
    When I try to configure the O365 new account on Outlook, I received the error : “connection is not secure / not encrypted”
    My SBS2011 has a self-signed certificate and DNS was configured for .local domain with another dns zone (remote.domain.com) (for public domain).
    Certificate was self-signed
    Maybe I have to delete the dns public dns zone ?
    Server was not exposed to internet. We uses POP3 Connector to retrieve emails from old provider

Leave a comment

Leave a Reply to Kirby Witmer Cancel reply

Your email address will not be published. Required fields are marked *