How to recreate the legacy Exchange Virtual Directories in Exchange 2010?


The Exchange 2010 install of the CAS role includes the installation of the legacy Exchange Virtual Directories. The Exchange, Public and Exchweb Virtual Directories are placed and configured directly in the IIS metabase, therefore these Virtual Directories are only local to the Server and no longer objects located in Active Directory.

Additionally, the Exchange 2010 New-OWAVirtualDirectory cmdlet no longer recognizes the -Name parameter and is hard coded to use "OWA" for the name. This behavior is by design.

NOTE: This behavior is different than that in Exchange 2007 where it was necessary to use the New-OWAVirtualDirectory in order to recreate the Exchange, Exchweb, and Public Virtual Directories.

NOTE: Running the cmdlet Remove-OWAVirtualDirectory will remove the Exchange, Exchweb, and Public Virtual Directories in addition to the OWA Virtual Directory. The New-OWAVirtualDirectory cmdlet will create a new OWA Virtual Directory as well as the Exchange, Exchweb, and Public Virtual Directories.

So what happens if we need to manage or recreate only the legacy Exchange Virtual Directories on an Exchange 2010 Server?

Since the legacy Exchange Virtual Directories are no longer listed and manageable in Active Directory, we need to use the appcmd utility (as we do to manage other Virtual Directories in IIS 7 and above) or add the Virtual Directories in IIS manually and modify the applicationHost.config file directly.

Option 1:

In order to recreate the legacy Exchange Virtual Directories using appcmd, take the following actions for each Virtual Directory (Exchange, Exchweb, and Public):

1) Open a command prompt, change directory to %SystemRoot%\System32\inetsrv

2) Replacing Default Web Site with the appropriate Site Name (if different) and <VDir> to the correct legacy Exchange Virtual Directory alias, Run the following commands:

  • appcmd delete vdir /vdir.name:"Default Web Site/<VDir>" /commit:APPHOST
  • appcmd add vdir /app.name:"Default Web Site"/ /path:/<VDir> /physicalPath:"<Exchange Install Directory>\V14\ClientAccess\Owa" /commit:APPHOST
  • appcmd set config "Default Web Site/<VDir>" /section:directoryBrowse /enabled:false /showFlags:"Date, Size, Extension, LongDate" /commit:APPHOST
  • appcmd set config "Default Web Site/<VDir>" /section:handlers /accessPolicy:Read /commit:APPHOST
  • appcmd set config "Default Web Site/<VDir>" /section:windowsAuthentication /enabled:false /commit:APPHOST
  • appcmd set config "Default Web Site/<VDir>" /section:anonymousAuthentication /enabled:true /commit:APPHOST
  • appcmd set config "Default Web Site/<VDir>" /section:digestAuthentication /enabled:false /commit:APPHOST
  • appcmd set config "Default Web Site/<VDir>" /section:basicAuthentication /enabled:false /commit:APPHOST
  • appcmd set config "Default Web Site/<VDir>" /section:defaultDocument /enabled:true /commit:APPHOST
  • appcmd set config "Default Web Site/<VDir>" /section:httpRedirect /enabled:true /destination:/owa /exactDestination:false /childOnly:false /httpResponseStatus:Found /commit:APPHOST

NOTE: I recommend putting the above into a batch file and make 3 copies. Modify each batch to replace the <VDir> with Exchange, Exchweb, or Public.

Option 2:

In order to recreate the legacy Exchange Virtual Directories manually, take the following actions for each Virtual Directory (Exchange, Exchweb, and Public):

1) Open IIS Manager, expand Default Web Site, right click on the <VDir> and choose Remove

2) Highlight the Default Web Site, and choose View Virtual Directories in the Actions pane.

3) In the Actions Pane, choose Add Virtual Directory... Add the correct Alias (Exchange, Exchweb, or Public) and Physical Path which is the "<Exchange Install Directory>\V14\ClientAcess\Owa" and click OK.

NOTE: Default Web Site is set to Anonymous by default, therefore the newly created Virtual Directories should also be set to Anonymous. If not, then modifying the applicationHost.config below will correct the authentication.

4) Once the above is complete, open the applicationHost.config file using notepad which is located in %SystemRoot%\System32\Inetsrv\config\

5) Search for the following: "Default Web Site/owa/14". Once found, look for the </location>, After the </location>, copy and paste the following text renaming <VDir> to the legacy Exchange Virtual Directory alias:

<location path="Default Web Site/<VDir>">
      <system.webServer>
           <directoryBrowse enabled="false" showFlags="Date, Size, Extension, LongDate" />
           <handlers accessPolicy="Read" />
           <security>
                <authentication>
                    <windowsAuthentication enabled="false" />
                    <anonymousAuthentication enabled="true" />
                    <digestAuthentication enabled="false" />
                    <basicAuthentication enabled="false" />
                </authentication>
           </security>
           <defaultDocument enabled="true" />
           <httpRedirect enabled="true" destination="/owa" exactDestination="false" childOnly="false" httpResponseStatus="Found">
                <clear />
           </httpRedirect>
       </system.webServer>
   </location>

After recreating the legacy Exchange Virtual Directories and modifying the applicationHost.config, open a command prompt and run:

Iisreset /noforce

- Steve Swift

Comments (3)
  1. Olivia Spensor says:

    That's great help for installation of the legacy Exchange Virtual Directories.People are very curious to know more about new thing in software.So this is really great info.

  2. Kyle says:

    I followed the instructions for Option 2 & the Public directory, however once finished I tried to connect (https://exserver/public/) and I receive a configuration error:

    Configuration Error
    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

    Source Error:

    Line 28: <system.web>
    Line 29: <httpRuntime maxRequestLength="30000" />
    Line 30: <authentication mode="Windows" />  
    Line 31: <sessionState mode="Off"/>
    Line 32:

    Any ideas?

  3. sswift says:

    More than likely there is another configuration in the applicationhost.config file or another web.config file in place that causing conflict and ultimately the /public to fail.

    Check through the web.config file under the OWA Directory and check the applicationhost.config file to ensure that the section on /public only has the authentication mechanisms and entries as listed above.

    Compare it to the /exchweb, they should be the same.

Comments are closed.

Skip to main content