本文介绍了在PowerShell中连接到CRM 2016 IFD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 我想使用SDK中包含的PowerShell cmdlet Get-CrmConnection 连接到CRM 2016服务器。 我无法找到正确的连接字符串。 连接到本地网络中的服务器正常工作: Get-CrmConnection -ConnectionString Url = http://< server> / OrganizationName; 但是连接到为IFD配置的服务器失败: Get-CrmConnection -ConnectionString Url = https://crm.ourdomain.com/ Get-CrmConnection:组织不能为null或为空。 参数名称:组织名称在第1行:char:1 + Get-CrmConnection -ConnectionString Url = https://crm.ourdomain.com/ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo:SyntaxError:(:) [Get-CrmConnection],ArgumentNullException + FullyQualifiedErrorId:-9,Microsoft.Xrm.Tooling.CrmConnector.Powershell.Commands.GetCrmConnectionCommand 我尝试在连接字符串中添加AuthType参数,提供组织名称,但没有成功,重要的是我可以使用交互模式进行连接: Get-CrmConnection -InteractiveMode 以下内容对我有用 get-crmconnection -ConnectionString Server = https:// {orgname }。{domain} .com / {orgname}; Domain = this_isnt_used_but_must_be_provided; UserName = {domain} \ {user}; Password = {password} 稍微修改的用户名也是如此,如UPN get-crmconnection -ConnectionString Server = https:// {orgname}。{domain} .com / {orgname}; Domain = this_isnt_used_but_must_be_provided; UserName = {user} @ {domain}; Password = {password} I would like to connect to CRM 2016 server using PowerShell cmdlet Get-CrmConnection included in the SDK.I am having trouble finding the correct connection string.Connecting to the server in in the local network works normally:Get-CrmConnection -ConnectionString "Url=http://<server>/OrganizationName;"But connecting to the server configured for IFD fails:Get-CrmConnection -ConnectionString "Url=https://crm.ourdomain.com/"Get-CrmConnection : Organization cannot be null or empty.Parameter name: Organization NameAt line:1 char:1+ Get-CrmConnection -ConnectionString "Url=https://crm.ourdomain.com/ ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SyntaxError: (:) [Get-CrmConnection], ArgumentNullException + FullyQualifiedErrorId : -9,Microsoft.Xrm.Tooling.CrmConnector.Powershell.Commands.GetCrmConnectionCommandI tried adding AuthType parameter in the connection string, providing Organization name, but no success. Important thing is that I can connect using the interactive mode:Get-CrmConnection -InteractiveModeThis returns the following connection:IsReady : TrueIsBatchOperationsAvailable : TrueAuthority :OAuthUserId :ActiveAuthenticationType : ADOrganizationServiceProxy : Microsoft.Xrm.Tooling.Connector.CrmWebSvc+ManagedTokenOrganizationServiceProxyOrganizationWebProxyClient :LastCrmError : OrganizationWebProxyClient is nullLastCrmException :CrmConnectOrgUriActual : https://crm.ourdomain.com/XRMServices/2011/Organization.svcConnectedOrgFriendlyName : OrganizationNameConnectedOrgUniqueName : OrganizationNameConnectedOrgPublishedEndpoints : {[WebApplication, https://crm.ourdomain.com/], [OrganizationService, https://crm.ourdomain.com/XRMServices/2011/Organization.svc], [OrganizationDataService, https://crm.ourdomain.com/XRMServices/2011/OrganizationData.svc]}ConnectionLockObject : System.ObjectConnectedOrgVersion : 8.0.1.79 解决方案 There are some big gotchas with the microsoft.xrm.tooling.connector CrmConnection that can have you banging your head against the wall.To quote from http://crmtipoftheday.com/2016/01/14/rumors-about-microsoft-xrm-client-death-are-exaggerated/The following works for me get-crmconnection -ConnectionString "Server=https://{orgname}.{domain}.com/{orgname}; Domain=this_isnt_used_but_must_be_provided; UserName={domain}\{user}; Password={password}"so does the slightly modified username as UPNget-crmconnection -ConnectionString "Server=https://{orgname}.{domain}.com/{orgname}; Domain=this_isnt_used_but_must_be_provided; UserName={user}@{domain}; Password={password}" 这篇关于在PowerShell中连接到CRM 2016 IFD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-07 21:14