Ever since Exchange Server 2010 Service Pack 1 dropped, administrators have had two methods to recreate the six Exchange virtual directories: reset them or reinstall the client access server role. Files are occasionally misconfigured or damaged by third-party apps, however, leaving virtual directories unusable. The virtual directory re-creation process is straightforward and well-documented, but it doesn’t always work, and troubleshooting is sometimes necessary.
Exchange Server 2010 SP1 was the first version of Exchange to allow admins to re-create virtual directories via the Exchange Management Console (EMC). In the Server Configuration node, click Client Access in the right-hand action pane. From there, you have the option to reset virtual directories. You then use the wizard to re-create the required virtual directory.
You can also recreate the virtual directories using the Exchange Management Shell (EMS). The syntax required for each virtual directory is different, but fortunately, Microsoft outlines the needed syntax.
Note: If you remove a virtual directory using the EMS, you cannot create the new one using the EMC. Virtual directories can only be re-created in the EMC.
Although the above processes should work fine, you may still see an error message stating that the virtual directory has not been re-created.
Troubleshooting Exchange 2010 virtual directory re-creation: Check your scripts
If you’ve tried to re-create the virtual directories via the EMS, the first thing to check is that you’ve used the proper syntax. The EMS is very unforgiving, and the error message doesn’t always make clear what the problem is. Each virtual directory has its own syntax, so be aware of the variants for each.
Second, check your spelling. I don’t want to sound like your English teacher, but the EMS doesn’t come with a spell checker. Check spelling and punctuation twice, and then check it again.
To get a better idea of what’s working and what isn’t, try using the –verbose switch at the end of the EMS command. This will give you the detailed breakdown of the command processing rather than just the part that failed.
Troubleshooting Exchange 2010 virtual directory re-creation: Has the virtual directory been fully removed?
If you still encounter virtual directory re-creation problems after performing the normal EMS checks, it may be that the original virtual directory was not fully removed.
The only way to know for sure is to check the IIS Metabase. If you don’t already have it, you must Windows Server 2008 R2. However, it is not supported. In other words, if it does cause you problems, you won’t get help from Microsoft.
If you see entries for a virtual directory that you’ve tried to remove in the IIS Metabase, then rename them (to be on the safe side) and run the new virtual directory command again.
Another area to troubleshoot is the Application Running mode in IIS. If your IIS Application pools are set to allow you to create 32-bit applications on a 64-bit machine, then you will probably see all sorts of virtual directory difficulties once an Exchange server is installed.
To ensure that this is turned off, run the following command:
Cscript c:inetpubadminscriptsadsutil.vbs SET /w3svc/AppPools/Enable32BitAppOnWin64 False
Troubleshooting Exchange 2010 virtual directory recreation: Web.config file issues
When recreating the virtual directories, understand that this simply recreates the IIS/Exchange collaboration elements. It doesn’t recreate the installation folders that contain the virtual directory information. For example, if you’ve made changes to the web.config file and you’ve identified it as the reason that a virtual directory has stopped working, then recreating your virtual directory is not the answer.
Note: If you ever plan to make changes to the web.config file of any virtual directory, back it up first, even if a web.config.bak file exists.
If you run the virtual directory recreation and still have web.config problems, check the installation directory listed in the web.config file under the </AppSettings> header for the given virtual directory. From a standard installation, the install directories are listed as %ExchangeInstallationDirectory%.
Although this typically works fine, you may still be unable to get to the Exchange virtual directories after you have recreated the virtual directory. If you have enabled debugging in the web.config file, then the error page displayed explains that an Exchange component is missing.
In order to fix this, go into the web.config file and do a find and replace to the actual physical path to your exchange install files: Drive:Program filesMicrosoftExchange serverV14Client Access.