Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)

Solution:

This seems OWA file already exists but the OWA Virtual Directory is not visible in IIS, this means the last uninstallation didn’t remove the virtual directory properly and this caused a bad cache in IIS Metabase causing the reinstallation from creating the OWA virtual directory. If OWA virtual Directory is not visible in IIS doesn’t mean it not exists, please check the IIS 7.0 Metabase

Find adsutil.vbs script on the CAS server, usually it’s in SystemDriver\Inetpub\AdminScripts

Then open cmd window, and “cd” to the above path

Use the command below to check the metabase, see if there’s any remained trace about /OWA virtual directory

Cscript adsutil.vbs enum w3svc/1/root

Try to uninstall iis and reinstall it back delete ClientAccessRole Key under HKLM\software\microsoft\exchange\v8.1 Go to ADSIEDIT => Exchange Servername object and change the value of msexchcurrentserver to 34

And start the CAS setup again

The IIS configuration files are located in ApplicationHost.config. This file is located in %windir%\system32\inetsrv\config. Found the below entry even with no owa vdir in IIS manager, remove the entries below and reinstall the CAS server role