While I was upgrading from Exchange server 2007 to Exchange server 2010 I got error below while trying to do configuration to OWA virtual directory on exchange 2010 server, the error was common between all tabs related to CAS and its virtual directories except ecp virtual directory.
The error:
An IIS directory entry couldn’t be created. The error message is Access is denied. . HResult = -2147024891 It was running the command ‘Get-OWAVirtualDirectory’
I thought first something wrong with my installation, but when I run get-owavirtualdirectory command line, I realized what the problem (actually not serious problem) is. EMC and EMS are trying to get virtual directories of Exchange 2007 CAS server by default. To get the right setting of virtual directory of Exchange server 2010 you have to get it from command line and add –server switch to define that you want to get or edit virtual directories of Exchange 2010 CAS server.
Guess what? This issue disappeared after I removed old Exchange 2007 CAS server. After the removal EMC gets the default settings of Exchange 2010 CAS server.
Regards