Error Preparing Schema for Exchange 2013

I recive this error when running the preparing AD for exchange 2013 on a 2012 r2 server. 

Error:

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

          #

          # O15# 2844081 - Create PartnerApplication "Exchange Online" in DC and On-Premise

          #

          $exch = [Microsoft.Exchange.Data.Directory.SystemConfiguration.WellknownPartnerApplicationIdentifiers]::Exchange;

          $exchApp = Get-PartnerApplication $exch -ErrorAction SilentlyContinue -DomainController $RoleDomainController | Where { $_.UseAuthServer };

          if ($exchApp -eq $null)

          {

              $exchAppName = "Exchange Online";

              $exchApp = New-PartnerApplication -Name $exchAppName -ApplicationIdentifier $exch -Enabled $RoleIsDatacenter -AcceptSecurityIdentifierInformation $false -DomainController $RoleDomainController;

          }

          # Create application account for Exchange

          $appAccountName = $exchApp.Name + "-ApplicationAccount";

          $appAccount = Get-LinkedUser -Identity $appAccountName -ErrorAction SilentlyContinue -DomainController $RoleDomainController;

          if ($appAccount -eq $null)

          {

            $appAccountUpn = $appAccountName.Replace(" ", "_") + "@" + $RoleFullyQualifiedDomainName;

            $appAccount = New-LinkedUser -Name $appAccountName -UserPrincipalName $appAccountUpn -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "UserApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "ArchiveApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "LegalHoldApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "Mailbox Search" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "TeamMailboxLifecycleApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "MailboxSearchApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            Set-PartnerApplication -Identity $exchApp.Identity -LinkedAccount $appAccount.Identity -DomainController $RoleDomainController;;

          }

        " was run: "Couldn't find a user with the identity "ESL.LOC/Users/Exchange Online-ApplicationAccount".".

Error:

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

          #

          # O15# 2844081 - Create PartnerApplication "Exchange Online" in DC and On-Premise

          #

          $exch = [Microsoft.Exchange.Data.Directory.SystemConfiguration.WellknownPartnerApplicationIdentifiers]::Exchange;

          $exchApp = Get-PartnerApplication $exch -ErrorAction SilentlyContinue -DomainController $RoleDomainController | Where { $_.UseAuthServer };

          if ($exchApp -eq $null)

          {

              $exchAppName = "Exchange Online";

              $exchApp = New-PartnerApplication -Name $exchAppName -ApplicationIdentifier $exch -Enabled $RoleIsDatacenter -AcceptSecurityIdentifierInformation $false -DomainController $RoleDomainController;

          }

          # Create application account for Exchange

          $appAccountName = $exchApp.Name + "-ApplicationAccount";

          $appAccount = Get-LinkedUser -Identity $appAccountName -ErrorAction SilentlyContinue -DomainController $RoleDomainController;

          if ($appAccount -eq $null)

          {

            $appAccountUpn = $appAccountName.Replace(" ", "_") + "@" + $RoleFullyQualifiedDomainName;

            $appAccount = New-LinkedUser -Name $appAccountName -UserPrincipalName $appAccountUpn -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "UserApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "ArchiveApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "LegalHoldApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "Mailbox Search" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "TeamMailboxLifecycleApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            New-ManagementRoleAssignment -Role "MailboxSearchApplication" -User $appAccount.Identity -DomainController $RoleDomainController;

            Set-PartnerApplication -Identity $exchApp.Identity -LinkedAccount $appAccount.Identity -DomainController $RoleDomainController;;

          }

        " was run: "Couldn't find a user with the identity "ESL.LOC/Users/Exchange Online-ApplicationAccount".".

April 9th, 2014 5:44pm

When you run the Setup.exe / PS / IAcceptExchangeServerLicenseTerms command to prepare the scheme did not receive any error? 
The account under which you run the command is a member of admins schema, Domain Admin? 

Regards

Free Windows Admin Tool Kit Click here and download it now
April 9th, 2014 9:42pm

Hi,

Fist, please check if there is an account which is Exchange Online-ApplicationAccount via ADUC.

By default, this account is disabled, please enable it and re-run Setup /PrepareAD again. It should success. After preparing AD schema, please disable the account again.

Best regards,
Belinda

April 10th, 2014 8:37am

Thank you very much.
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2014 9:29am

stop the internet connection wile you are running setup (just for this error)

For virtual machines just remove default gateway IP if you are connected with Remote Desktop

March 27th, 2015 5:29am

stop the internet connection wile you are running setup (just for this error)

For virtual machines just remove default gateway IP if you are connected with Remote Desktop

Free Windows Admin Tool Kit Click here and download it now
March 27th, 2015 9:27am

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

Other recent topics Other recent topics