locked
Exchange 2016 installation failed, unable to uninstall or install again. Mailbox role and others didnt install RRS feed

  • Question

  • During my installation of Exchange 2016 it failed and didnt install all of the roles.   when I try to do a recovery I get the following error:

    File copy complete. Setup will now collect additional information needed for installation.

    Languages
    Management tools
    Mailbox role: Transport service
    Mailbox role: Front End Transport service

    Performing Microsoft Exchange Server Prerequisite Check

        Configuring Prerequisites                                                                         COMPLETED
        Prerequisite Analysis                                                                             COMPLETED

    Configuring Microsoft Exchange Server

        Language Files                                                                                    COMPLETED
        Restoring Services                                                                                COMPLETED
        Language Configuration                                                                            COMPLETED
        Exchange Management Tools                                                                         COMPLETED
        Mailbox role: Transport service                                                                   FAILED

    When I try to uninstall from control panel I get the following:

    Error:
    The following error was generated when "$error.Clear(); 
              & $RoleBinPath\ServiceControl.ps1 -Operation:DisableServices -Roles:($RoleRoles.Replace('Role','').Split(',')) -SetupScriptsDirectory:$RoleBinPath;
              & $RoleBinPath\ServiceControl.ps1 Stop $RoleRoles.Replace('Role','').Split(',')
            " was run: "Microsoft.PowerShell.Commands.ServiceCommandException: Service 'Application Identity (AppIDSvc)' cannot be configured due to the following error: Access is denied ---> System.ComponentModel.Win32Exception: Access is denied
       --- End of inner exception stack trace ---".

    Error:
    The following error was generated when "$error.Clear(); 
              & $RoleBinPath\ServiceControl.ps1 -Operation:DisableServices -Roles:($RoleRoles.Replace('Role','').Split(',')) -SetupScriptsDirectory:$RoleBinPath;
              & $RoleBinPath\ServiceControl.ps1 Stop $RoleRoles.Replace('Role','').Split(',')
            " was run: "System.Management.Automation.MethodInvocationException: Exception calling "Reverse" with "1" argument(s): "Value cannot be null.
    Parameter name: array" ---> System.ArgumentNullException: Value cannot be null.
    Parameter name: array
       at System.Array.Reverse(Array array)
       at CallSite.Target(Closure , CallSite , Type , Object )
       --- End of inner exception stack trace ---
       at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
       at CallSite.Target(Closure , CallSite , Type , Object )
       at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
       at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)".

    Can anyone recommend how to complete the removal properly?  I currently have an exchange 2013 server that i am trying to migrate to Exchange 2016

    Sunday, April 26, 2020 10:25 PM

All replies

  • Hi,

    Instead of uninstalling from Control Panel, please use the same Exchange 2016 media and then execute the command below via Command Prompt(run as Administrator) to see if the uninstallation can be successful:

    Setup.exe /mode:Uninstall /IAcceptExchangeServerLicenseTerms

    If it doesn’t work, please run ADSIEdit.msc and remove Exchange 2016 from the location below: 
    CN=configuration -> DC=domain name,DC=com -> CN=Services -> CN=Microsoft Exchange -> CN=<YourExchOrgName> -> CN=Administrative Group -> CN=Exchange Administrative Group -> CN=Servers
    (Important: ADSI Edit must be handled with care. Modifying the attributes using ADSIEdit can cause significant issues with your infrastructure if something is done in a wrong way. We would suggest you make a backup before modifying.)

    Then try reinstalling Exchange 2016 and see if it works. In case it still fails, please get back to us with the error message. Also it’s suggested to look into the Exchange setup log file located at <system drive>:\ExchangeSetupLogs\ExchangeSetup and see if there are any clues. 

    Any updates, please feel free to post back.

    Regards,

    Yuki Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Monday, April 27, 2020 5:34 AM
  • Hi - I tried the Uninstall and the results are below.

    Welcome to Microsoft Exchange Server 2016 Cumulative Update 2 Unattended Setup

    Languages
    Management tools
    Mailbox role: Transport service
    Mailbox role: Front End Transport service
    Performing Microsoft Exchange Server Prerequisite Check
        Configuring Prerequisites                                                                         COMPLETED
        Prerequisite Analysis                                                                             COMPLETED
    Configuring Microsoft Exchange Server
        Preparing Setup                                                                                   COMPLETED
        Stopping Services                                                                                 FAILED
    The following error was generated when "$error.Clear();
     & $RoleBinPath\ServiceControl.ps1 -Operation:DisableServices
    -Roles:($RoleRoles.Replace('Role','').Split(',')) -SetupScriptsDirectory:$RoleBinPath;
     &
    $RoleBinPath\ServiceControl.ps1 Stop $RoleRoles.Replace('Role','').Split(',')
     " was run:
    "Microsoft.PowerShell.Commands.ServiceCommandException: Service 'Application Identity (AppIDSvc)' cannot be configured
    due to the following error: Access is denied ---> System.ComponentModel.Win32Exception: Access is denied
     --- End of
    inner exception stack trace ---".

    The Exchange Server setup operation didn't complete. More details can be found in ExchangeSetup.log located in the
    <SystemDrive>:\ExchangeSetupLogs folder.

    Monday, April 27, 2020 5:36 PM
  •  

    Hi,

    May I know if you have also tried removing Exchange 2016 from ADSI and then performing a reinstallation, did it fail as well?

    I did further research on the errors you shared above, and found that the “Access is denied” error in the message might be related to the “Debug programs” user right. Please launch “gpedit.msc”, navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment. Ensure that the group of Exchange Administrators that install Exchange 2016 has the user rights assignment to debug programs.

    Besides, regarding the “Service 'Application Identity (AppIDSvc)' cannot be configured” mentioned in the error, please refer to the steps below and see if it works:
    1. Navigate to the “ServiceControl.ps1” via <Service Pack installation path>:\Setup\ServerRoles\common\

    2. Backup the file. Then open the file with Notepad, press Ctrl+F, search for “$script:servicesToControl['Common']” to locate the following line:

    $script:servicesToControl['Common']             = @( 'WinMgmt', 'RemoteRegistry', 'HealthService', 'OnePoint', 'MOM', 'OMCFG', 'pla', 'AppIDSvc' )


    3. Remove the 'AppIDSvc' portion in the line, so that this line will be like as follows: 

    $script:servicesToControl['Common']             = @( 'WinMgmt', 'RemoteRegistry', 'HealthService', 'OnePoint', 'MOM', 'OMCFG', 'pla' )


    4. Manually stop the Application Identity (AppIDSvc) service and then run the uninstall command line again to check the result.

    For more derails, you may refer to the thread below:
    Unable to update Admin Tools to Exchange 2013 CU 10 on Windows 10 machine

    Regards,

    Yuki Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Tuesday, April 28, 2020 9:27 AM
  • In response to your first question I didn't try removing the server from the AD because I couldn't find good instructions on how to do it.  I did speak with Microsoft and they were unable to help or provide the AD removal instructions.  I must not have had the best support tech on the phone.  If you could provide them that would be great.  I wish that I had your suggestion yesterday.  I tried doing an upgrade using CU 15.  It got much of the way thru but then failed.  I am unable to run /recovermode even though those are the instructions that the installer gives me when the install fails.  The easiest way at this point would be to remove Exchange 2016 from the AD, roll back the VM to before I installed Exchange and see if I can run the install again and succeed.  

    Here is the information from the latest log:

    [04/29/2020 01:44:43.0052] [0] **********************************************
    [04/29/2020 01:44:43.0061] [0] Starting Microsoft Exchange Server 2016 Setup
    [04/29/2020 01:44:43.0061] [0] **********************************************
    [04/29/2020 01:44:43.0064] [0] Local time zone: (UTC-05:00) Eastern Time (US & Canada).
    [04/29/2020 01:44:43.0065] [0] Operating system version: Microsoft Windows NT 6.2.9200.0.
    [04/29/2020 01:44:43.0068] [0] Setup version: 15.1.1913.5.
    [04/29/2020 01:44:43.0070] [0] Logged on user: contoso\Admineq.
    [04/29/2020 01:44:43.0123] [0] Command Line Parameter Name='sourcedir', Value='C:\Exchange2016CU15'.
    [04/29/2020 01:44:43.0123] [0] Command Line Parameter Name='mode', Value='Install'.
    [04/29/2020 01:44:43.0130] [0] RuntimeAssembly was started with the following command: '/sourcedir:C:\Exchange2016CU15 /mode:Install'.
    [04/29/2020 01:44:43.0418] [0] The following roles are installed: BridgeheadRole ClientAccessRole MailboxRole UnifiedMessagingRole FrontendTransportRole AdminToolsRole
    [04/29/2020 01:44:46.0468] [0] Setup is choosing the domain controller to use
    [04/29/2020 01:44:46.0769] [0] The MSExchangeADTopology has a persisted domain controller: IBMx36507979.contoso.nyc
    [04/29/2020 01:44:51.0753] [0] PrepareAD has been run, and has replicated to this domain controller; so setup will use IBMx36507979.contoso.nyc
    [04/29/2020 01:44:51.0753] [0] Setup is choosing a global catalog...
    [04/29/2020 01:44:51.0821] [0] Setup has chosen the global catalog server IBMx36507979.contoso.nyc.
    [04/29/2020 01:44:51.0849] [0] Setup will use the domain controller 'IBMx36507979.contoso.nyc'.
    [04/29/2020 01:44:51.0850] [0] Setup will use the global catalog 'IBMx36507979.contoso.nyc'.
    [04/29/2020 01:44:51.0853] [0] Exchange configuration container for the organization is 'CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=contoso,DC=nyc'.
    [04/29/2020 01:44:51.0867] [0] Exchange organization container for the organization is 'CN=Com Tek CADD,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=contoso,DC=nyc'.
    [04/29/2020 01:44:51.0892] [0] Setup will search for an Exchange Server object for the local machine with name 'CT-EXCH16'.
    [04/29/2020 01:44:52.0352] [0] Exchange Server object found : 'CN=CT-EXCH16,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Com Tek CADD,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=contoso,DC=nyc'.
    [04/29/2020 01:44:52.0357] [0] The following roles have been unpacked: BridgeheadRole FrontendTransportRole AdminToolsRole
    [04/29/2020 01:44:52.0360] [0] The following datacenter roles are unpacked:
    [04/29/2020 01:44:52.0360] [0] The following roles are installed: BridgeheadRole ClientAccessRole MailboxRole UnifiedMessagingRole FrontendTransportRole AdminToolsRole
    [04/29/2020 01:44:52.0363] [0] The local server has some Exchange files installed.
    [04/29/2020 01:44:52.0383] [0] Server Name=CT-EXCH16
    [04/29/2020 01:44:52.0402] [0] Setup will use the path 'C:\Exchange2016CU15' for installing Exchange.
    [04/29/2020 01:44:52.0405] [0] Setup will discover the installed roles from server object 'CN=CT-EXCH16,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Com Tek CADD,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=contoso,DC=nyc'.
    [04/29/2020 01:44:52.0406] [0] 'BridgeheadRole' is installed on the server object.
    [04/29/2020 01:44:52.0412] [0] The backup copy of the install path is 'C:\Program Files\Microsoft\Exchange Server\V15'.
    [04/29/2020 01:44:52.0412] [0] The backup copy of the previously installed version is '15.1.466.34'.
    [04/29/2020 01:44:52.0414] [0] The installation mode is set to: 'BuildToBuildUpgrade'.
    [04/29/2020 01:44:54.0226] [0] An Exchange organization with name 'Com Tek CADD' was found in this forest.
    [04/29/2020 01:44:54.0227] [0] Active Directory Initialization status : 'True'.
    [04/29/2020 01:44:54.0228] [0] Schema Update Required Status : 'False'.
    [04/29/2020 01:44:54.0228] [0] Organization Configuration Update Required Status : 'False'.
    [04/29/2020 01:44:54.0229] [0] Domain Configuration Update Required Status : 'False'.
    [04/29/2020 01:44:54.0232] [0] The locally installed version is 15.1.1913.5.
    [04/29/2020 01:44:54.0232] [0] Exchange Installation Directory : 'C:\Program Files\Microsoft\Exchange Server\V15'.
    [04/29/2020 01:44:54.0321] [0] Setup is determining what organization-level operations to perform.
    [04/29/2020 01:44:54.0322] [0] Because the value was specified, setup is setting the argument OrganizationName to the value Com Tek CADD.
    [04/29/2020 01:44:54.0323] [0] The installed MSI is current for this version of Setup.
    [04/29/2020 01:44:54.0340] [0] RootDataHandler has 1 DataHandlers
    [04/29/2020 01:44:54.0356] [0] Validating options for the 2 requested roles
    [04/29/2020 01:44:54.0356] [0] UpgradeModeDataHandler has 7 handlers and 7 work units
    [04/29/2020 01:44:54.0383] [0] [ERROR] The Exchange Server is in an inconsistent state. Only disaster recovery mode is available. Please use Setup /m:RecoverServer to recover this Exchange server.
    [04/29/2020 01:44:57.0185] [0] CurrentResult launcherbase.maincore:90: 1
    [04/29/2020 01:44:57.0186] [0] CurrentResult setupbase.maincore:396: 1
    [04/29/2020 01:44:57.0188] [0] End of Setup
    [04/29/2020 01:44:57.0188] [0] **********************************************

    Thanks for your help.

    Wednesday, April 29, 2020 1:45 AM
  • The easiest way at this point would be to remove Exchange 2016 from the AD, roll back the VM to before I installed Exchange and see if I can run the install again and succeed.  

    Hi,

    To remove Exchange 2016 from AD, please refer to the steps below:
    (Important: ADSI Edit must be handled with care. Modifying the attributes using ADSIEdit can cause significant issues with your infrastructure if something is done in a wrong way. We would suggest you make a backup before modifying.)

    1. Press Win+R, type “adsiedit.msc”, press Enter to launch ADSI Editor.
    2. Click “Action”, choose “Connect to”, select “Configuration”, OK:
    3. Expand the path and navigate to the location as follows: CN=configuration,DC=domain name,DC=com -> CN=Services -> CN=Microsoft Exchange -> CN=<YourExchOrgName> -> CN=Administrative Groups -> CN=Exchange Administrative Group -> CN=Servers
    4. Right click “Exchange 2016”, choose “Delete”:

    By the way, as this is a public forum, we have removed the sensitive information in your previous reply to protect the personal info. Please do not include data like real domain names in a post if you need to share more details about the issue. Thanks for your understanding.

    Regards,

    Yuki Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Wednesday, April 29, 2020 6:14 AM
  • Hi,

    I am writing to see if the provided information was helpful. Any update would be appreciated.

    Regards, 

    Yuki Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Tuesday, May 5, 2020 6:53 AM