Solved: Creating Dynamics CRM organization error

Problem:

On a Microsoft Dynamics CRM 2011 Server, creating an organization met the following error:

Solved: Creating Dynamics CRM organization error

The log:

16:52:20|   Info| Grant access for ServiceAccount: NT AUTHORITY\NetworkService, WebAppAccount: NT AUTHORITY\NETWORK SERVICE.
16:52:20|   Info| CrmAction execution time; GrantCrmDatabaseAccessAction; 00:00:04.4684354
16:52:20|   Info| Executing Install action: Microsoft.Crm.Tools.Admin.SetReportsUnpublishedAction
16:52:20|   Info| CrmAction execution time; SetReportsUnpublishedAction; 00:00:00.0156239
16:52:20|   Info| Executing Install action: Microsoft.Crm.Tools.Admin.FlushMetadataCacheAction
16:52:20|   Info| CrmAction execution time; FlushMetadataCacheAction; 00:00:00.1093673
16:52:20|   Info| Executing Install action: Microsoft.Crm.Tools.Admin.ProvisionBusinessAction
16:52:34|   Info| CrmAction execution time; ProvisionBusinessAction; 00:00:14.6085307
16:52:34|  Error| Installer Complete: OrganizationCreator - Error encountered
16:52:34|  Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationCreator: Action Microsoft.Crm.Tools.Admin.ProvisionBusinessAction failed.
InnerException:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DirectoryServices.DirectoryServicesCOMException: The server is unwilling to process the request. (Exception from HRESULT: 0x80072035)
   --- End of inner exception stack trace ---
   at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
   at Microsoft.Crm.SecurityUtils.AddPrincipalToGroup(SecurityIdentifier sid, DirectoryEntry groupEntry)
   at Microsoft.Crm.SecurityUtils.AddPrincipalToGroup(Guid principalId, SecurityIdentifier sid, Guid groupId)
   at Microsoft.Crm.BusinessEntities.SecurityLibrary.AddPrincipalToGroup(Guid principalId, SecurityIdentifier sid, Guid groupId)
   at Microsoft.Crm.Authentication.UserManagementFactory.ManageGroupMembership(Guid activeDirectoryId, SecurityIdentifier identifier, Boolean remove, ExecutionContext context)
   at Microsoft.Crm.Authentication.UserManagementFactory.AddPrincipalToGroup(UserAuthenticationInformation userInformation, ExecutionContext context)
   at Microsoft.Crm.Authentication.UserManagementFactory.CreateUser(IBusinessEntity systemUser, Boolean setupUser, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.CreateInternal(Guid organizationId, IBusinessEntity systemuser, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.OrganizationServiceInternal`1.CreateRootBusiness(IBusinessEntity organization, IBusinessEntity business, IBusinessEntity systemUser, ExecutionContext context)
   at Microsoft.Crm.Setup.Server.Utility.NewOrgUtility.OrganizationCreateNew(String organizationId, String organizationName, String userAccountName, String userFirstName, String userLastName, String userEmail, String featureSetFile, String languageCode, String privilegedUserGroup, String sqlAccessGroup, String reportingGroup, String privilegedReportingGroup, Boolean grantNetworkServiceAccess, OrganizationResourceHelper orgSettingsHelper)
   at Microsoft.Crm.Tools.Admin.ProvisionBusinessAction.Do(IDictionary parameters)
   at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
InnerException:
System.DirectoryServices.DirectoryServicesCOMException (0x80072035): The server is unwilling to process the request. (Exception from HRESULT: 0x80072035)

16:52:34|   Info| Setting organization state.  New state = Failed
16:52:34|  Error| Create new Organization (Name=46c00c53-3ef4-e211-aa9b-00155d79e868, Id=JeffTian2) failed with Exception:
System.Exception: Action Microsoft.Crm.Tools.Admin.ProvisionBusinessAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DirectoryServices.DirectoryServicesCOMException: The server is unwilling to process the request. (Exception from HRESULT: 0x80072035)
   --- End of inner exception stack trace ---
   at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
   at Microsoft.Crm.SecurityUtils.AddPrincipalToGroup(SecurityIdentifier sid, DirectoryEntry groupEntry)
   at Microsoft.Crm.SecurityUtils.AddPrincipalToGroup(Guid principalId, SecurityIdentifier sid, Guid groupId)
   at Microsoft.Crm.BusinessEntities.SecurityLibrary.AddPrincipalToGroup(Guid principalId, SecurityIdentifier sid, Guid groupId)
   at Microsoft.Crm.Authentication.UserManagementFactory.ManageGroupMembership(Guid activeDirectoryId, SecurityIdentifier identifier, Boolean remove, ExecutionContext context)
   at Microsoft.Crm.Authentication.UserManagementFactory.AddPrincipalToGroup(UserAuthenticationInformation userInformation, ExecutionContext context)
   at Microsoft.Crm.Authentication.UserManagementFactory.CreateUser(IBusinessEntity systemUser, Boolean setupUser, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.CreateInternal(Guid organizationId, IBusinessEntity systemuser, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.OrganizationServiceInternal`1.CreateRootBusiness(IBusinessEntity organization, IBusinessEntity business, IBusinessEntity systemUser, ExecutionContext context)
   at Microsoft.Crm.Setup.Server.Utility.NewOrgUtility.OrganizationCreateNew(String organizationId, String organizationName, String userAccountName, String userFirstName, String userLastName, String userEmail, String featureSetFile, String languageCode, String privilegedUserGroup, String sqlAccessGroup, String reportingGroup, String privilegedReportingGroup, Boolean grantNetworkServiceAccess, OrganizationResourceHelper orgSettingsHelper)
   at Microsoft.Crm.Tools.Admin.ProvisionBusinessAction.Do(IDictionary parameters)
   at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
   --- End of inner exception stack trace ---
   at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)
   at Microsoft.Crm.Setup.Common.Installer.Install(IDictionary stateSaver)
   at Microsoft.Crm.Tools.Admin.OrganizationOperation.Install(IDictionary stateSaver)
   at Microsoft.Crm.Tools.Admin.OrganizationCreator.Install(IDictionary stateSaver)
   at Microsoft.Crm.Tools.Admin.OrganizationOperation.Execute()
   at Microsoft.Crm.Tools.Admin.OrganizationCreator.Execute()
   at Microsoft.Crm.Tools.Admin.CreateOrganizationInstaller.Create(ICreateOrganizationInfo organizationInfo)
16:52:34|   Info| GetDBUpdateRevisionThresholdForServer(): Threshold = 3448.

Solution:

Set Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\AutoGroupManagementOff = 1

Set Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM\AutoGroupManagementOff = 1

Retry creating again, it will succeed.

Add comment

Loading