PowerShell issue Dynamics CRM & 365 IFD

I was trying to onfigure a Dynamics 365 server to enable federated claims.

$ClaimsSettings = Get-CrmSetting -SettingType OAuthClaimsSettings
$ClaimsSettings.Enabled = $true
Set-CrmSetting -Setting $ClaimsSettings

But got this error>

Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> Add-PSSnapin Microsoft.Crm.PowerShell
PS C:\Windows\system32> $ClaimsSettings = Get-CrmSetting -SettingType OAuthClaimsSettings
Get-CrmSetting : The underlying connection was closed: An unexpected error occurred on a send.
At line:1 char:19
+ $ClaimsSettings = Get-CrmSetting -SettingType OAuthClaimsSettings
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Crm.P…rmSettingCmdlet:GetCrmSettingCmdlet) [Get-CrmSetting
], WebException
+ FullyQualifiedErrorId : CRM Deployment Cmdlet Error,Microsoft.Crm.PowerShell.GetCrmSettingCmdlet

The solution was to fix the Web Address properties of the CRM server in CRM Deployment Manager. These Web Addresses were not the same as the address of our IFD deployment.

I found the solution here: http://rickardnorstrom.blogspot.se/2013/02/ (Thanks!)

Dynamics Connector with CRM 2016 problem resolved!

We were running Microsoft Dynamics NAV 2015, Dynamics CRM 2015 and Dynamics Connector – working fine!

But when we upgraded to CRM 2016 the Dynamics Connector stopped working with these errors below.

Connector Log

Metadata contains a reference that cannot be resolved:

Event Log

Inner Exception: [System.Xml.XmlException] The maximum nametable character count quota (16384) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing – long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 1330.

Solution

The solution was to replace these DLL’s in the Dynamics Connector program files directory with the new files from CRM 2016 SDK.

  • Microsoft.Crm.Sdk.Proxy.dll
  • Microsoft.Xrm.Sdk.dll

 

 

ISSUE:

On your Dynamics CRM 2016, organization (crmnolia) , when try to integrate it with Microsoft Dynamics NAV 2015 using Connector Version (3.4.304.1) , during the configuration you have the following error :  Metadata contains a reference that cannot be resolved: ‘https://crmnolia.umea.se/Nolia/XRMServices/2011/Organization.svc?wsdl=wsdl0’.

 CAUSE:

Problem with the following dlll “Microsoft.Xrm.Sdk.dll”.

RESOLUTION:

1. Closed Connector

2. Stopped Connector Service

3. Downloaded “Microsoft Dynamics CRM 2015 Software Development Kit (SDK)”

4. Backed up file “Microsoft.Xrm.Sdk.dll” from “C:\Program Files (x86)\Microsoft Dynamics\Microsoft Dynamics Adapter\Adapters\Microsoft.Dynamics.Integration.Adapters.Crm2011\” folder

5. Replaced “Microsoft.Xrm.Sdk.dll” file in Dynamics Adapter folder with the one from the 2015 SDK Bin folder (Original file version: 7.0.0.516; New file version: 7.1.0.1085)

6. Started Connector Service

 

Dynamics CRM Outlook Client Invalid OrganizationId

Re-post from http://quantusdynamics.blogspot.se/2012/03/dynamics-crm-2011-outlook-client.html?showComment=1440595982105#c8457841292289090860. Thank you, Nuno Costa!

———————–

Dynamics CRM 2011 Outlook Client Invalid OrganizationId

I suddenly found myself unable to configure any Dynamics CRM 2011 Outlook client, receiving the following error:

>Failed to refresh entry. Exception Microsoft.Crm.Application.SMWrappers.InvalidOrganizationIdException: Invalid OrganizationId “xxxxx566-5xxx-e1xx-adxx-xxxx56af0xxx”.
at Microsoft.Crm.Application.SMWrappers.ClientOrganizationContextFactory.Get(Guid organizationId)
at Microsoft.Crm.Application.SMWrappers.ClientOrganizationContextFactory.Microsoft.Crm.IOrganizationContextFactory.GetOrganizationContext(Guid organizationId)
at Microsoft.Crm.Caching.CrmMultiOrgCache`2.RefreshClientEntryCallback(String key)
at Microsoft.Crm.ClientCrmCache`1.RefreshEntryWaitCallback(Object keyString)

It seems this happened after enabling SPN’s to work with the CRM 2011 FetchXml reports. The resolution is to enable IIS to authenticate using the AppPool Account credentials.

Resolution
In IIS highlight the CRM website and open the Configuration Editor

Navigate to:
system.webServer > security > authentication > windowsAuthentication

Set useAppPoolCredentials to True

Use the Diagnostics Trace from CRM Outlook client to read log mentioned. Also this error is found in configuration log:

10:54:58|Verbose| Method entry: Microsoft.Crm.Application.Outlook.Config.OutlookConfigurator.InitializeMapiStoreForFirstTime
10:57:44|  Error| Exception : An error has occurred. Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization’s Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.    at Microsoft.Crm.MapiStore.DataStore.WaitInitialized()
at Microsoft.Crm.Application.Outlook.Config.OutlookConfigurator.InitializeMapiStoreForFirstTime()
at Microsoft.Crm.Application.Outlook.Config.OutlookConfigurator.Configure(IProgressEventHandler progressEventHandler)
at Microsoft.Crm.Application.Outlook.Config.ConfigEngine.Configure(Object stateInfo)
10:57:44|  Error| Exception : Server was unable to process request.

———————–

Dynamics CRM 2011 Outlook Client Invalid OrganizationId

I suddenly found myself unable to configure any Dynamics CRM 2011 Outlook client, receiving the following error:

>Failed to refresh entry. Exception Microsoft.Crm.Application.SMWrappers.InvalidOrganizationIdException: Invalid OrganizationId “xxxxx566-5xxx-e1xx-adxx-xxxx56af0xxx”.
at Microsoft.Crm.Application.SMWrappers.ClientOrganizationContextFactory.Get(Guid organizationId)
at Microsoft.Crm.Application.SMWrappers.ClientOrganizationContextFactory.Microsoft.Crm.IOrganizationContextFactory.GetOrganizationContext(Guid organizationId)
at Microsoft.Crm.Caching.CrmMultiOrgCache`2.RefreshClientEntryCallback(String key)
at Microsoft.Crm.ClientCrmCache`1.RefreshEntryWaitCallback(Object keyString)

It seems this happened after enabling SPN’s to work with the CRM 2011 FetchXml reports. The resolution is to enable IIS to authenticate using the AppPool Account credentials.

Resolution
In IIS highlight the CRM website and open the Configuration Editor

Navigate to:
system.webServer > security > authentication > windowsAuthentication

Set useAppPoolCredentials to True

Dynamics Connector Submit Button on Account Contact not working

I configured the Dynamics Connector for CRM 2015 and NAV. When testing the Account mapping I clicked the Submit button on the account form. Nothing happend! After a couple of hours I realized that the Javascript function behind the button checked for ReadyForIntegration = false. But in my case the account already created were ReadyForIntegration = null. New accounts were given a default value of false.

Simply changing the value to false instead of null allowed the Submit button to work. I also modified the Javascript to check for null as well as false.

Microsoft Dynamics Connector for CRM 2015 and NAV – Product Bundles

Be aware that Product Bundles introduced in CRM 2015 is not supported by the Dynamics Connector.

When using required bundle Products, CRM business process throws an exception on Submit Order. With optinal bundle Products the order gets submitted but error occurs in the Connector (LineIntegrationID null).

I have created a case with MS support. Will update this post if problem is solved.

Microsoft Dynamics CRM: how to create new view for order/invoice/opportunity products entity

If you want to add/create a new view for any of the Opportunity Products, Order Products or Invoice Products entities, you will find there is no button to create a new view.

Still it is possible to create new views. Just open the existing default view “All Order Products” and then click Save As…

WARNING! Don’t do this as it will cause other problems: http://community.dynamics.com/crm/f/117/t/117274

Dynamics CRM 2011/2013: Change web address

One of the most common tasks with a Dynamics CRM installation must be to change the web address (URL) to a user-friendly host header. But documentation on how to is hard to find. Here’s how I did it.

Thanks to: http://social.microsoft.com/Forums/en-US/b829d747-ff8c-435f-ad82-01dc2bca60b9/crm-2011-change-url?forum=crmdeployment

  • Update the IIS bindings for the CRM 2011 website on the server running CRM to the new value you want to use
    • Open IIS Manager
    • Select the Microsoft Dynamics CRM website
    • Click ‘Bindings’ in the action panel at the right of the screen
    • Select the binding to modify
    • Click ‘Edit’ and modify the host name and port to the new value.
    • Close the dialog and IIS Manager.
  • Update the ServerURL registry entry with the new URL you want to use. The registry entry can be found at KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM. Note that the key value should be of the form http(s)://<New URL>:<Port Number>/MSCRMServices
  • Modify the global settings for CRM from within the Microsoft Dynamics CRM Deployment Manager*:
    • Start the Microsoft Dynamics CRM Deployment Manager
    • Right-click on the ‘Microsoft Dynamics CRM’ entry at the top of the left pane of the window shown
    • Click ‘Properties’
    • Select the ‘Web Address’ tab on the dialog which is shown
    • Modify the addresses shown appropriately. Note that if the binding type is modified from HTTP to HTTPS you will need to install the appropriate certificate into IIS as well.
    • Click OK to close the dialog and close Microsoft Dynamics CRM Deployment Manager
  • Restart the Microsoft Dynamics CRM Asynchronous Processing Service, or restart the server
  • Make sure you have set your SPN’s correctly. Add SPN for the domain account running your CRM applicationpool. I needed three SPN records to make it work. Without all of them I received a Not Authorized error. “Error 401. The requested resource requires user authentication” 

    • Add them by running command “SETSPN -A HTTP/crm.domain.com DOMAIN\CRMServiceAccount
    • I needed: HTTP/computername, HTTP/computername:5555 and HTTP/crm.domain.com
  • Then Add entry to DNS :

sth, crm, dev, auth, to indicate to server IP

  • Then go to registry:

In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Right-click Lsa, point to New, and then click DWORD Value.
Type DisableLoopbackCheck, and then press ENTER.
Right-click DisableLoopbackCheck, and then click Modify.
In the Value data box, type 1, and then click OK.
Quit Registry Editor, and then restart your computer.

(I believe this last step is only necessary to browse the friendly URL from the server)