Fixing a broken OWA 2010 Virtual Directory

Reading Time: 3 minutes

Several days ago a co-worker needed my assistance with a broken Outlook Web App 2010. A failed attempt to configure the root to redirect it to \owa unfortunately failed. Trying to repair it also failed and at the end OWA was broken. A restore did not fix the issue.

Now, Exchange 2010 SP1 has the ability to reset Virtual Directories used by the Exchange Client Access Role. Unfortunately, this didn’t work. Trying to remove the OWA virtual directory with:

Remove-OwaVirtualDirectory -Identity 'EX\owa (Default Web Site)'

Resulted in an error:

The operation couldn't be performed because object 'EX\owa (Default Web Site)' couldn't be found on 'dc.domain.local'.
+ CategoryInfo          : NotSpecified: (0:Int32) [Remove-OwaVirtualDirectory], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : ED277526,Microsoft.Exchange.Management.SystemConfigurationTasks.RemoveOwaVirtualDirectory

So it couldn’t find the OWA virtual directory… Let’s make a new one:

New-OwaVirtualDirectory -InternalUrl 'https://ex.domain.local/owa' -WebSiteName 'Default Web Site'

But alas:

An error occurred while creating the IIS virtual directory 'IIS://EX.domain.local/W3SVC/1/ROOT/owa' on 'EX'.
+ CategoryInfo          : InvalidOperation: (EX\owa (Default Web Site):ADObjectId) [New-OwaVirtualDirectory], InvalidOperationException
+ FullyQualifiedErrorId : 513D170,Microsoft.Exchange.Management.SystemConfigurationTasks.NewOwaVirtualDirectory

A deadlock. But an educated guess was that the errors seem to indicate that the information stored in Active Directory was missing or corrupt.

As a last resort I recreated the Virtual Directory in IIS. Then I looked via ADSIedit on a working Exchange 2010SP1 server, which settings where registered in AD.

It seemed the configuration is stored in object:

CN=owa (Default Web Site), CN=HTTP, CN=Protocols, CN=ex, CN=Servers, CN=Exchange Administrative Group (FYDIBOHF23SPDLT), CN=Administrative Groups, CN=First Organization, CN=Microsoft Exchange, CN=Services, CN=Configuration, DC=domain, DC=local.

 

CN=owa (Default Web Site),CN=HTTP,CN=Protocols,CN=EX,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=First Organization,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=domain,DC=local

I created a new object on the failed server (it was indeed missing), with class msExchOwaVirtualDirectory

msExchOwaVirtualDirectory

And a common name of owa (Default Web Site)

owa (Default Web Site)

You will need to add more attributes, but you already finish this wizard.

image

I copied most attributes that seemed relevant to me from the example server to the failed server and it did leave me with a working OWA!

However, MIME types where not present and could not be easily transferred. As this was in any case a “troubled” virtual directory, I decided to try the reset the OWA virtual directory once again.

It worked and resulted in a pristine default OWA virtual directory! For now it looks like the result is acceptable for production.

A thank you goes out to SimonD and RolandZ for their assistance!

 

DISCLAIMER: Do not use ADSIedit when you don’t know what you are doing. Improper use can damage your Active Directory or other services beyond repair! This information is provided as is and for educational purposes.

 

Further reading:

Reset Client Access Virtual Directories

Remove-OwaVirtualDirectory

New-OwaVirtualDirectory

Managing Client Access Server Virtual Directories

One comment

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.