问题描述
我们已将Dynamics CRM 4更新汇总6配置为IFD,并已使用部署配置工具设置了UserRootPath。通过CRM界面添加用户非常有效。但是,当尝试通过CrmService API添加用户时,未添加该用户,并且我们获得了下面包含的跟踪消息。如果我们从组织中删除UserRootPath设置,则可以通过CrmService API添加用户。该路径似乎是正确的,可以在其他LDAP工具中使用,并且用户位于指定的OU中。我们正在使用路径 LDAP:// dcserver / OU = testorg; OU = Hosting; DC = domain; DC = local。
We have Dynamics CRM 4 update rollup 6 configured as an IFD and have set the UserRootPath using the deployment configuration tool. Adding users through the CRM interface works perfectly. However, when trying to add a user through the CrmService API, the user is not added and we get the trace message included below. Adding users through the CrmService API works if we remove the UserRootPath setting from the organization. The path appears to be correct, works within other LDAP tools, and the user is within the specified OU. We are using the path "LDAP://dcserver/OU=testorg;OU=Hosting;DC=domain;DC=local".
[2009-09-29 13:19:54.7] Process: w3wp |Organization:---- |Thread: 9 |Category: Platform.Sdk |User: ---- |Level: Error | CompositeSoapExtensionExceptionHandler.Handle
>CrmSoapExtension detected CrmException:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DirectoryServices.DirectoryServicesCOMException (0x80072020): An operations error occurred.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindOne()
at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.CheckUserUnderRootPath(String domainAccountName, ExecutionContext context)
at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.CreateInternal(Guid organizationId, IBusinessEntity systemuser, ExecutionContext context)
at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.Create(IBusinessEntity systemuser, ExecutionContext context)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IPluginExecutionContext context)
at Microsoft.Crm.Extensibility.PluginStep.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.Execute(String messageName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, PropertyBag fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
at Microsoft.Crm.Sdk.RequestBase.Process(Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
at Microsoft.Crm.Sdk.RequestBase.Process(CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
at Microsoft.Crm.Sdk.CrmServiceInternal.Execute(RequestBase request, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId)
at Microsoft.Crm.Sdk.Crm2007.CrmService.Execute(Request request)
--- End of inner exception stack trace ---
推荐答案
0x80072020错误与AD中的通用访问被拒绝有关。
The 0x80072020 error is related to a generic "Access Denied" in AD.
取决于根据您的配置,您可以尝试通过修改以下内容来查明问题所在:
Depending on your configuration, you could try to pinpoint the issue by modifying the following:
1)使用Active Directory用户和应用程序池用户授予代理选项电脑。
2)将web.config添加到MSCRMServices文件夹并启用模拟,例如:
1) Grant the "delegate" option to the application pool user using Active Directory Users and Computers.2) Add a web.config to the MSCRMServices folder and turn impersonation on such as:
<身份impersonate = true userName = mydomain\bob password = builder />
< identity impersonate="true" userName="mydomain\bob" password="builder" />
这篇关于无法在Dynamics CRM中使用CrmService API添加用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!