We used to have on premise exchange server which is integrated with active directory (the PDC and Exchange Server are all the same Windows 2008 small business server). We migrated our Exchange to Office 365 and everything works fine however, for the users whose machines are a member of the domain, anytime they want to add a new profile, they are automatically connected to the local on-premise exchange instead of Office365.

Our local auto discover is configured so that it points to Office 365's autodiscover (autodiscover.outlook.com) and still it connects to the local server.

Any thoughs on how to disintegrate our MS Exchange from Active Directory, at least for some users?

  • We are dealing with a similar situation in my environment with Office 365 and Exchange 2010. I am curious to see how this works out. Until then, we have to manually configure our outlook clients to point to the right server. Sep 29 '14 at 16:36
  • Can you elaborate on the config, i.e. did you go through the manual settings? What did you put as the exchange server?
    – Mahdi
    Sep 29 '14 at 16:38
  • Manually set to mail.outlook.com; it seems to figure the rest out itself Oct 1 '14 at 13:31

The recommended steps at the end of this post can help greatly: http://community.office365.com/en-us/f/156/t/176968.aspx I have not tested it yet as we have some other users that will use the old exchange for now, but it seems pretty promising. This can be done either per user or for the whole system.

To Recap:

  1. Decomissioning the Exchange Server as per MSFT migration instructions does the trick.

  2. Taking the following steps disables autodiscover:

    1. Open an elevated Exchange Management Shell and retrieve the current autodiscover virtual directory:

      Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, Identity

      Copy the Identity value to the clipboard. Note the internal URL

    2. In the Exchange Management Shell, remove the autodiscover virtual directory:

      Remove-AutodiscoverVirtualDirectory -Identity ''

      You will have to confirm by typing a "A".

    3. Check that the autodiscover virtual directory is gone:

      Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, Identity

      1. Internal mailbox records in AD and they may cause issues:

    Active Directory Users and Groups > View > Advanced Features

    Look at the properties for each user and on the attribute editor tab clear the homeMDB and homeMTA attributes. These are also cleared once the mailboxes are disabled.


When you have migrated your mailboxes to Exchange Online / Office 365 using a staged migration, you should follow the provided instructions to convert your on-premises mailboxes to mail-enabled users.


To get outlook to connect to Office 365 using Autodiscover, you need to add the a CNAME record in your domain's public DNS, pointing to autodiscover.outlook.com and kill the local autodiscover (AD SCP). You can do this by simply running Get-ClientAccessServer | Set-ClientAccessServer -AutodiscoverInternalURL $Null

The clients will then not find an internal autodiscover source and will go straight to public DNS > Exchange online.

  • We have done the CNAME in DNS. Get-CASServer seems to be invalid command for me (Exchange 2007), only Get-CASMailbox works.
    – Mahdi
    Sep 30 '14 at 20:07
  • Sorry, use Get-ClientAccessServer, I'll edit my answer Oct 1 '14 at 9:14

I want to report that taking down the internal autodiscover down solved our problem, that is:

Get-AutodiscoverVirtualDirectory | fl Name, Server, InternalUrl, Identity

and then

Remove-AutodiscoverVirtualDirectory -Identity 'IDENTITY'

where IDENTITY is from the first command. Note that it will not disrupt Outlook web access, but it will disable local discovery and so if there are still local users who want to access local server, you need to manually enter the exchange server address.

The other note is that this will work perfectly for the new profiles you create and the old ones for some reason keep using the autodiscovery URL. So I'd recommend creating clean new profiles for users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.