Error when adding the Mailbox Role to what was a CAS only Server (Ex 2013)

We have a server that was just hosting the CAS role, Exchange 2013 CU7, Server 2012.  The need to add the Mailbox Role presented itself, which seems like a fairly easy task to accomplish.  During the install (using the CU7 install media) the following error occurred and failed the entire install. 

Any help would be appreciated.  If it looks to be too involved, I might end up exercising a TechNet support session but would prefer not to if it's a fairly easy fix. 

This is a production environment, all 2013 Exchange Servers.

During Step 1 of 5:  Mailbox Role: Client Access service

Error:

The following error was generated when "$error.Clear();

          $BEVdirIdentity = $RoleNetBIOSName + "\OWA (Exchange Back End)";

          new-OwaVirtualDirectory -Role Mailbox -WebSiteName "Exchange Back End" -DomainController $RoleDomainController;

          set-OwaVirtualdirectory -Identity $BEVdirIdentity -FormsAuthentication:$false -WindowsAuthentication:$true;

        " was run: "System.InvalidOperationException: An error occurred while creating the IIS virtual directory 'IIS://XXXXX.domain.local/W3SVC/2/ROOT/owa' on '<server name>'. ---> System.Runtime.InteropServices.COMException: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)

   at System.DirectoryServices.Interop.UnsafeNativeMethods.IAdsContainer.Create(String className, String relativeName)

   at System.DirectoryServices.DirectoryEntries.Add(String name, String schemaClassName)

   at Microsoft.Exchange.Management.Metabase.IisUtility.CreateWebDirObject(String parent, String path, String vdirName)

   at Microsoft.Exchange.Management.Metabase.CreateVirtualDirectory.Execute()

   at Microsoft.Exchange.Management.SystemConfigurationTasks.NewExchangeVirtualDirectory`1.CreateToMetabase()

   at Microsoft.Exchange.Management.SystemConfigurationTasks.NewExchangeVirtualDirectory`1.InternalProcessRecord()

   --- End of inner exception stack trace ---

   at Microsoft.Exchange.Configuration.Tasks.Task.WriteError(Exception exception, ErrorCategory category, Object target, Boolean reThrow, String helpUrl)

   at Microsoft.Exchange.Configuration.Tasks.Task.WriteError(Exception exception, ErrorCategory category, Object target)

   at Microsoft.Exchange.Management.SystemConfigurationTasks.NewExchangeVirtualDirectory`1.InternalProcessRecord()

   at Microsoft.Exchange.Configuration.Tasks.Task.<ProcessRecord>b__b()

   at Microsoft.Exchange.Configuration.Tasks.Task.InvokeRetryableFunc(String funcName, Action func, Boolean terminatePipelineIfFailed)".

Error:

The following error was generated when "$error.Clear();

          $BEVdirIdentity = $RoleNetBIOSName + "\OWA (Exchange Back End)";

          new-OwaVirtualDirectory -Role Mailbox -WebSiteName "Exchange Back End" -DomainController $RoleDomainController;

          set-OwaVirtualdirectory -Identity $BEVdirIdentity -FormsAuthentication:$false -WindowsAuthentication:$true;

        " was run: "Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException: The operation couldn't be performed because object 'EMAILGW2013\OWA (Exchange Back End)' couldn't be found on 'WPB08DC1.autec.pvt'.

   at Microsoft.Exchange.Configuration.Tasks.DataAccessTask`1.GetDataObject[TObject](IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, OptionalIdentityData optionalData, Nullable`1 notFoundError, Nullable`1 multipleFoundError, ExchangeErrorCategory errorCategory)

   at Microsoft.Exchange.Configuration.Tasks.DataAccessTask`1.GetDataObject[TObject](IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, OptionalIdentityData optionalData, Nullable`1 notFoundError, Nullable`1 multipleFoundError)

   at Microsoft.Exchange.Configuration.Tasks.SetObjectWithIdentityTaskBase`3.ResolveDataObject()

   at Microsoft.Exchange.Configuration.Tasks.SetSystemConfigurationObjectTask`3.ResolveDataObject()

   at Microsoft.Exchange.Configuration.Tasks.SetObjectTaskBase`2.PrepareDataObject()

   at Microsoft.Exchange.Management.SystemConfigurationTasks.SetVirtualDirectory`1.PrepareDataObject()

   at Microsoft.Exchange.Management.SystemConfigurationTasks.SetExchangeVirtualDirectory`1.PrepareDataObject()

   at Microsoft.Exchange.Management.SystemConfigurationTasks.SetWebAppVirtualDirectory`1.PrepareDataObject()

   at Microsoft.Exchange.Configuration.Tasks.SetTaskBase`1.InternalValidate()

   at Microsoft.Exchange.Configuration.Tasks.SetSystemConfigurationObjectTask`3.InternalValidate()

   at Microsoft.Exchange.Management.SystemConfigurationTasks.SetExchangeVirtualDirectory`1.InternalValidate()

   at Microsoft.Exchange.Management.SystemConfigurationTasks.SetWebAppVirtualDirectory`1.InternalValidate()

   at Microsoft.Exchange.Management.SystemConfigurationTasks.SetOwaVirtualDirectory.InternalValidate()

   at Microsoft.Exchange.Configuration.Tasks.Task.<ProcessRecord>b__b()

   at Microsoft.Exchange.Configuration.Tasks.Task.InvokeRetryableFunc(String funcName, Action func, Boolean terminatePipelineIfFailed)".

The Setup logs also show the following:

[05/06/2015 13:44:07.0723] [1] [ERROR] The operation couldn't be performed because object '<ServerName\OWA (Exchange Back End)' couldn't be found on '<DCname.domain.local'.
[05/06/2015 13:44:07.0723] [1] [ERROR-REFERENCE] Id=ClientAccessOwaComponent___62bd834915a7470798aa47ba1f2b6800 Component=EXCHANGE14:\Current\Release\Shared\Datacenter\Setup
[05/06/2015 13:44:07.0723] [1] Setup is stopping now because of one or more critical errors.
[05/06/2015 13:44:07.0723] [1] Finished executing component tasks.
[05/06/2015 13:44:07.0754] [1] Ending processing Install-ClientAccessRole

Thanks!

Chris

May 6th, 2015 9:53am

Hi,

According to your description, I understand that failed add mailbox role in existing CAS server with error An error occurred while creating the IIS virtual directoryCannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7).
If I misunderstand your concern, please do not hesitate to let me know.

I want to double confirm which mothed are you used to add mailbox role.
After you install any server roles on a computer running Exchange 2013, you can't use the Exchange 2013 Setup wizard to add any additional server roles to this computer. If you want to add more server roles to a computer, you must either use Add or Remove Programs from Control Panel or use Setup.exe from a Command Prompt window.

If the issue persists, heres the similar thread about this error, for your reference:
https://social.technet.microsoft.com/Forums/exchange/en-US/70e2870c-9acc-4da6-8434-8c20ba119436/owa-vd-creation-fails-cannot-create-a-file-when-that-file-alreaady-exists-hresult-0x800700b7?forum=exchangesvrclientslegacy
https://social.technet.microsoft.com/Forums/office/en-US/32e06b5b-76bb-45d0-bf99-0b83c3182199/exchange-2013-cu2-upgrade-to-cu3-failed-at-front-end-transport-service?forum=exchangesvrdeploy
Note: please testing in lad after modify the configuration in production environment.

Thanks

Free Windows Admin Tool Kit Click here and download it now
May 7th, 2015 2:23am

I did receive the error by clicking on setup.exe and running it as admin. I wouldn't have imagined that would be an issue as the setup wizard allowed me to choose the role I wanted to add. I will try from add/remove programs and update the forum with results. Setup detects an incomplete installation right now. Is that going to be a problem? Or will add/remove programs move beyond that?' If not, is there a Rey key that dictates this behavior?
May 7th, 2015 3:54pm

Hi,

Yes, I recommend restart system before re-install Exchange server.
If the issue persists, please post the details error message in ExchangeSetup.log.

Thanks

Free Windows Admin Tool Kit Click here and download it now
May 8th, 2015 10:37am

Thank you for your continued assistance.

Machine was rebooted.

Running from Programs and Features causes the following popup error:

"The installation failed. Run setup from an installation media location."

All I can do is click OK and it exits. 

[05/08/2015 16:45:56.0587] [0] Local time zone: (UTC-05:00) Eastern Time (US & Canada).
[05/08/2015 16:45:56.0587] [0] Operating system version: Microsoft Windows NT 6.2.9200.0.
[05/08/2015 16:45:56.0587] [0] Setup version: 15.0.1044.29.
[05/08/2015 16:45:56.0587] [0] Logged on user: <DOMAIN\user>.
[05/08/2015 16:45:56.0634] [0] The installation has failed. Run setup from an installation media location.
[05/08/2015 16:51:05.0678] [0] CurrentResult setupbase.maincore:396: 1
[05/08/2015 16:51:05.0678] [0] End of Setup
[05/08/2015 16:51:05.0678] [0] **********************************************

I have not yet attempted to run from command line yet, however I suspect the same results as running from Programs and Features.  It's Friday and running it now would violate my "no new things on Friday's" rule.  Just to verify though, is this the correct syntax (assuming the setup.exe file is located in the BIN folder).

Setup.exe /mode:install /Role:MB /InstallWindowsComponents /IacceptExchangeServerLicenseTerms

How about this option?  CU8 is available for install, would I be able to run that, adding the role at that time?

May 8th, 2015 1:00pm

Hi,

The setup.exe command to install Mailbox role server, sample as below:

Setup.exe /mode:Install /role:MB /IAcceptExchangeServerLicenseTerms /TargetDir:"D:\Program Files\Microsoft\Exchange Server\V15" /mdbname:DAG1DB1 /dbfilepath:d:\MDB\EXDB\DAG1DB1.edb /Logfolderpath:d:\MDB\EXLog

Please help collect ExchangeSetup.log and send it to GBSD TN Office Information Collection ibsofc@microsoft.com, it will more helpful for further troubleshooting.

Free Windows Admin Tool Kit Click here and download it now
May 10th, 2015 10:32pm

Installation using the command like failed.  I cleansed log of sensitive information and sent to the email address above. 

Log file says it cannot find the Exchangeserver.msi file.  Can I extract that from the CU7 package and place it in the folder that setup is trying to find it?  Seems logical...

May 11th, 2015 10:16am

A second log was sent to the requested email address with more information.  This information was obtained by first copying the requested MSI from the CU7 package into the BIN folder, then running the setup.exe from the BIN folder.
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2015 10:40am

Hi,

Sorry for my mistake.
Please send message to this e-mail address (ibsexc@microsoft.com).

Thanks

May 12th, 2015 6:06am

Logs were re-sent to the new email address.
Free Windows Admin Tool Kit Click here and download it now
May 12th, 2015 8:32am

Do you suppose that if I removed the following Registry Key (Action Install), I would be able to start the installation of the Mailbox Role over from the beginning, but this time from within Control Panel/Programs and Features?

HKLM/SOFTWARE/Microsoft/ExchangeServer/v15/ClientAccessRole

REG_SZ - Action:Install

(I'm not even sure WHY it sees the CAS role as 'installing", it was already a role on the machine running in production.)

I'm not sure I have a way to test it other than to just go for it. 

May 12th, 2015 5:11pm

Hi,

Basic on your log, I find some message for your reference:
[05/11/2015 14:02:42.0821] [0] [ERROR] File exchangeserver.msi does not exist in specified directory X:\Program Files\Microsoft\Exchange Server\V15\bin.

[05/11/2015 14:27:08.0146] [1] [REQUIRED] A Setup failure previously occurred while installing the ClientAccessRole role. Either run Setup again for just this role, or remove the role using Control Panel.
[05/11/2015 14:27:08.0146] [1] Help URL: http://technet.microsoft.com/library(EXCHG.150)/ms.exch.setupreadiness.InstallWatermark.aspx
[05/11/2015 14:27:08.0146] [1] Failed [Rule:InstallWatermark] [Message:A Setup failure previously occurred while installing the ClientAccessRole role. Either run Setup again for just this role, or remove the role using Control Panel.]

We can try to copy exchangeserver.msi to X:\Program Files\Microsoft\Exchange Server\V15\bin then try to add Mailbox role by Add or Remove Programs from Control Panel again, then collect ExchangeSetup.log located in the <SystemDrive>:\ExchangeSetupLogs folder.

Thanks

Free Windows Admin Tool Kit Click here and download it now
May 13th, 2015 9:45am

Thanks again for your assistance.

Below are things I have tried to this point.

1.  Removed the reg entry as noted above.  This did not allow for install using Control Panel (same message here about using media), however I was able to run from the CU7 install package and progress further down the install path.

2.  Install got about 75% complete when the new error popped up about the "Push" directory needing to be removed.  I had to remove it with adsiedit as well as locally with asdutil.vbs. 

3.  Install again from CU7 package, now runs through "Step 1 of 5 Mailbox Role: Client Access Service and fails with:

Error:

The following error was generated when "$error.Clear();

          $BEVdirIdentity = $RoleNetBIOSName + "\OWA (Exchange Back End)";

          new-OwaVirtualDirectory -Role Mailbox -WebSiteName "Exchange Back End" -DomainController $RoleDomainController;

          set-OwaVirtualdirectory -Identity $BEVdirIdentity -FormsAuthentication:$false -WindowsAuthentication:$true;

        " was run: "System.InvalidOperationException: An error occurred while creating the IIS virtual directory 'IIS://SERVERNAME/W3SVC/2/ROOT/owa' on 'SERVERNAME'. ---> System.Runtime.InteropServices.COMException: Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)

I emailed the cleansed logs that occurred from this failure. 

This sure is quite frustrating, it's hard to believe it's taking me weeks to get past all these error just to add a role.

Do you suppose at some point I just need to remove this CAS server entirely from the email environment and just start over? 

May 13th, 2015 12:52pm

Update;

I followed some instructions from a posting you referenced early on that dealt with removing the IIS Virtual Directories when the above errors would occur, thus letting the install rebuild them.  Doing so allowed me to complete the install of the Mailbox Role.  However, the CAS role took a beating, as the IIS virtual directories I had to remove were not recreated and creating them post install is failing.  I have copied the text below.  If we are now out of the scope of this posting, let me know and I'll start a new one. 

[PS] C:\Windows\system32>New-OwaVirtualDirectory -SERVER "<Server>" -WebSite "Exchange Back End" -ExternalUrl "https://<URLofWebsite>/ecp" -InternalUrl "/ecp">https://<URLofWebsite>/ecp"

An error occurred while creating the IIS virtual directory 'IIS://<FQNDofServer>/W3SVC/1/ROOT/owa' on
'<Server>'.
    + CategoryInfo          : InvalidOperation: (<Server>\owa (Default Web Site):ADObjectId) [New-OwaVirtualDirecto
   ry], InvalidOperationException
    + FullyQualifiedErrorId : [Server=<Server>,RequestId=d0786385-dd80-40e4-b280-f3a633c7f193,TimeStamp=5/13/2015 8
   :46:46 PM] [FailureCategory=Cmdlet-InvalidOperationException] 38BE9420,Microsoft.Exchange.Management.SystemConfigu
  rationTasks.NewOwaVirtualDirectory
    + PSComputerName        : <FQNDofServer>

[PS] C:\Windows\system32>

Free Windows Admin Tool Kit Click here and download it now
May 13th, 2015 4:58pm

Hi,

Basis on setup log, it indicate that error occur on create the IIS virtual directory 'IIS://SERVERNAME.DOMAIN.DOMAIN/W3SVC/2/ROOT/owa' on 'SERVERNAME' because that file already exists.

Please download and install Metabase Explorer(it also works with Exchange 2013), then run it as administrator and expand to W3SVC --> 1 --> Root --> OWA, dont delete it first, rename it to whatever.
After above complete, then use Add or Remove Programs from Control Panel add mailbox role again.

Thanks

May 14th, 2015 6:03am

Allen,

Thank you again for your assistance in figuring out this small mess.

I did look at the metadata and didn't see much there to re-name, and using the Control Panel to add the role again was not an option. 

I ended up finding the TechNet forum linked below that included the following commands that assisted in rebuilding the Virtual Directories. The switch that made the different was the "-role clientaccess" option.

new-ecpvirtualdirectory -internalurl https://xx.xx.xx/ecp -role clientaccess -server servername -websitename "Default Web Site" -Path "C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\ecp"

https://social.technet.microsoft.com/Forums/en-US/01d1312f-da17-44b2-9626-5b3cbedc6c55/exchange-2013-unable-to-recreate-ecp-virtual-directory-using-newecpvirtualdirectory?forum=exchangesvradmin&prof=required

The machine now has a fully functional CAS and Mailbox role.

Thank you!

Chris R

  • Marked as answer by Have Fun 13 hours 48 minutes ago
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2015 1:42pm

Allen,

Thank you again for your assistance in figuring out this small mess.

I did look at the metadata and didn't see much there to re-name, and using the Control Panel to add the role again was not an option. 

I ended up finding the TechNet forum linked below that included the following commands that assisted in rebuilding the Virtual Directories. The switch that made the different was the "-role clientaccess" option.

new-ecpvirtualdirectory -internalurl https://xx.xx.xx/ecp -role clientaccess -server servername -websitename "Default Web Site" -Path "C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\ecp"

https://social.technet.microsoft.com/Forums/en-US/01d1312f-da17-44b2-9626-5b3cbedc6c55/exchange-2013-unable-to-recreate-ecp-virtual-directory-using-newecpvirtualdirectory?forum=exchangesvradmin&prof=required

The machine now has a fully functional CAS and Mailbox role.

Thank you!

Chris R

  • Marked as answer by Have Fun Thursday, May 14, 2015 5:40 PM
May 14th, 2015 5:40pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics