Troubleshooting “XXX Virtual Directory Already Exists” Issues RRS feed

  • General discussion

  • On the CAS Role, the Exchange install a lot of important virtual directories, such as OWA, EWS, OAB, ActiveSync, to provide more features and access methods for email clients. As these features are mostly handled by IIS, when you apply any changes on these virtual directories like changing the OWA authentication, changing the autodiscover SCP urls, the following things happen:

    1. The changes are made from Exchange ECP/EMS/EMC
    2. These changes are stored to the AD (DC)

    3. AD sync (one-way sync) changes to IIS metabase every 15 minutes (by default).


    If any of the above processes has problems, you will encounter the “XXX Virtual Directory Already Exists” when you trying to removing/recreating the virtual directories. Even during some Exchange updating, you will see this error message in installation log and let to a failure install of the update.


    In this situation, we need to manually remove the objects in AD and IIS metabase and renew the virtual directory from scratch. Here are the detailed steps(We will use autodiscover virtual directory as an example):

    1. In EMS, please run the following command:

    Remove-Autodiscovervirtualdirectory –Identity “CAS\Autodiscover (xxxxx)”

    2. Remove the autodiscover objects in AD

    a. Open ADSIEDIT.msc, locate:

    Configuration-->CN=Services-->CN=Microsoft Exchange-->CN=Organization-->CN=Administrative Groups-->CN=Exchange Administrative Groups-->CN=Servers-->CN=Exchange-->CN=Protocols-->CN=HTTP

    b. In the right pane, please check whether the CN=Autodiscover (xxx) is present. If so, please remove it.

    3. Delete the autodsicover in metabase

    a. Download the IIS 6.0 Resource Kit Tools from the following link:


    b. Install it on the CAS server. Open the “Metabase Explorer”
    c. Locate: Exchange -> LM -> W3SVC -> 1 -> ROOT.
    d. Please check whether Autodiscover is present, if so, remove it.

    4. After that, please retry the command and see if the autodiscover can be created.


    Set-ClientAccessServer -Identity CAS –AutodiscoverServiceInternalUri https://xxxx/autodiscover/autodiscover.xml

    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Tuesday, March 31, 2015 1:49 AM