Get-CrmSetting : The term ‘Get-CrmSetting’ is not recognized as the name of a cmdlet

Problem

While trying to run the OAuth provider setup in Microsoft Dynamics CRM, to configure among other things the Post-instillation setup to allow connectivity by devices and applications. I was banging my head on a problem following the instructions:

Configure the OAuth provider

 

Follow these steps to configure the OAuth provider in Microsoft Dynamics 365.

  1. Log on to the Microsoft Dynamics 365 server as an administrator.

  2. In a Windows PowerShell console window, run the following script.

     
    $ClaimsSettings = Get-CrmSetting -SettingType OAuthClaimsSettings
    $ClaimsSettings.Enabled = $true
    Set-CrmSetting -Setting $ClaimsSettings
    
    
Found on this page: https://msdn.microsoft.com/en-us/library/hh699726.aspx#BKMK_WS2012R2 
 
I was getting in the Power Shell: 
PS C:\Users\administrator.FSERVER4> $ClaimsSettings = Get-CrmSetting -SettingType OAuthClaimsSettings

Get-CrmSetting : The term ‘Get-CrmSetting’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:19
+ $ClaimsSettings = Get-CrmSetting -SettingType OAuthClaimsSettings
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-CrmSetting:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Driving me nuts!

 

The Fix

Turns out from these instructions found here: https://msdn.microsoft.com/en-us/library/dn531010.aspx

That an additional step is required:

Dynamics 365 server setup

 

To configure the Dynamics 365 server to enable federated claims, follow these steps.

Configure claims settings

  1. Log on as administrator on the Dynamics 365 server that hosts the deployment service role and open a Windows PowerShell command window.

  2. Add the Dynamics 365Windows PowerShell snap-in (Microsoft.Crm.PowerShell.dll). More information: TechNet: Administer the deployment using Windows PowerShell

     
    Add-PSSnapin Microsoft.Crm.PowerShell
    
  3. Enter the following Windows PowerShell commands.

     
    $ClaimsSettings = Get-CrmSetting -SettingType OAuthClaimsSettings
    $ClaimsSettings.Enabled = $true
    Set-CrmSetting -Setting $ClaimsSettings
    
    
 Note the step 2: 

Add-PSSnapin Microsoft.Crm.PowerShell

Now it works!

Screenshot 2017 01 10 14 36 47

Microsoft CRM IFD The SSL certificate does not contain all UPN suffix values that exist in the enterprise – Cannot Login

Cannot Login to a Previously working Microsoft CRM IFD

A previously working IFD deployment of CRM 2016 (but could be CRM 2015 or CRM 2013). About 1 year after you set the system up, you start receiving: 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.

When researching this error, we suspected what it was, and related to an article we covered here: http://www.interactivewebs.com/blog/index.php/crm-2013/microsoft-crm-2013-or-2015-event-id-1309-adfs-ifd-resolution/

However we never found and EVENT ID 1309 or anything close to that in our logs. The closest error we found (and we are not even certain that it was pointing as a result fo this problem) was the error:  EVENT ID 415

The SSL certificate does not contain all UPN suffix values that exist in the enterprise.  Users with UPN suffix values not represented in the certificate will not be able to Workplace-Join their devices.  For more information, see http://go.microsoft.com/fwlink/?LinkId=311954.

The Problem

This problem arises from a Certificate Rollover that the ADFS server does about 1 month out from your 1 year anniversary. The problem is that the ADFS certificate rolls over, but the CRM configuration does not pickup that new certificate.

 

The Fix

o locate your ADFS Certificates, navigate to the ADFS Console. Under “Service”, click on “Certificates”, where you will find a Primary and Secondary certificate. If the current date is close to the date of your Primary certificate “Effective Date”, it’s safe to assume that this is the underlying issue.

adfs2

To resolve this issue:

1. Navigate to the ADFS Console >> Trust Relationships >> Relying Party Trusts.
2. Right click on the trust and select “Update from Federation Metadata…”
a. If there are two trusts, do them both. This may be a case where you have one for Internal and External.

adfs3

3. Open Command Prompt. Be sure to right-click and “Run as Administrator”.
a. From within CMD, type “iisreset”.

adfs4

4. Open “Services” and restart the “ADFS” service.

adfs5

a. If ADFS does not start, be sure to check the “Windows Internal Database” service and make sure it is started, and then try restarting the ADFS service.

If these initial steps do not resolve your issue for any reason, continue with the following steps below:

5. Navigate to “CRM Deployment Manager”.
a. Run “Configure Claims-Based Authentication” wizard, upper right hand corner.
b. Click “Next” all the way through the wizard, nothing needs to be changed here.

adfs6

6. Run “Configure Internet Facing Deployment” wizard.
a. Click “Next” all the way through the wizard, nothing needs to be changed here either.

adfs7

7. Now, perform Steps 1-4 again as outlined above.
a. Update Federation Metadata
b. IISReset
c. Restart ADFS Service

Your users should be able to log-in to Dynamics CRM again. I hope you find this helpful and that it resolved your issue.

Microsoft CRM global search fails causing in-line search SQL error

CRM in-line search fails with SQL error

After upgrading Microsoft CRM from earlier versions we found that the global search function when enabled failed to return any results, and once the index for the global search had run over a 24-hour period, the in-line search function for any entity would cause a crash and SQL error message to be displayed on page.

The problem

In our particular instance this CRM environment had been upgraded from much earlier versions of CRM and included an attempt to solve some upgrade issues by dropping indexes. Initially our thoughts were that the dropping of the indexes were responsible for the problems. However it appears retrospectively that was a fragmentation of indexes that cause the issue. I cannot be exactly sure why the maintenance procedure that is run on the SQL Server did not rebuild and reorganise the indexes sufficiently that the global social function. However the following solution did work for us.

 We had pretty much followed the recommendation of this discussion forum.

The Solution

After submitting a support ticket to Microsoft they requested us to:

  • Run following command on CRM database to check fragmentation percentage:

 

SELECT object_id AS ObjectID,  index_id AS IndexID, avg_fragmentation_in_percent AS PercentFragment,

fragment_count AS TotalFrags, avg_fragment_size_in_pages AS PagesPerFrag,  page_count AS NumPages

FROM sys.dm_db_index_physical_stats(DB_ID(”), NULL, NULL, NULL , ‘DETAILED’) WHERE avg_fragmentation_in_percent > 0 ORDER BY ObjectID, IndexID

 

 

  • In case the fragmentation percent is more than 25-30% we have to rebuild the indexes.

Reference: https://msdn.microsoft.com/en-us/library/ms189858.aspx

  the reference provided by Microsoft was helpful, but not as helpful as we would have liked. We ended up running the following query that automatically rebuilt all the indexes.

DECLARE @TableName VARCHAR(255)
DECLARE @sql NVARCHAR(500)
DECLARE @fillfactor INT
SET 
@fillfactor 80
DECLARE TableCursor CURSOR FOR
SELECT 
OBJECT_SCHEMA_NAME([object_id])+‘.’+name AS TableName
FROM sys.tables
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS 0
BEGIN
SET 
@sql ‘ALTER INDEX ALL ON ‘ @TableName ‘ REBUILD WITH (FILLFACTOR = ‘ CONVERT(VARCHAR(3),@fillfactor) + ‘)’
EXEC (@sql)
FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE 
TableCursor
DEALLOCATE TableCursor
GO

 

 

After doing this, we were then able to turn on the global search and weight the relevant period of time for it to complete the indexing. It appears to have fixed our problem with both global search returning valid results, and in-line search no longer broken when global search was unable.

ZenDesk to Microsoft CRM integration password change

Changing your password in ZenDesk may affect your Microsoft CRM integration

 if you are to upgrade or change the password that you utilise in your ZenDesk system for the account that has been set to synchronise data with the Microsoft CRM platform, you will notice that the synchronisation may not function correctly or may only perform a one-way synchronisation. 

You will remember from the instructions that you likely followed in your initial configuration: http://www.interactivewebs.com/blog/index.php/zendesk/zendesk-to-crm-2015-integration/  

 that part of these configuration settings is to set up your password and username in the SETTINGS / ZD Personal Settings –  area of your Microsoft CRM system.

 Below is an extract from the vendor’s configuration portal found here

Step 2: Setting up new security roles

The Zendesk integration introduces two new security roles to Microsoft Dynamics CRM that must be assigned before you can proceed to the next step:

  • Zendesk – Read configuration settings – grants the user  access to Zendesk ticket details in read-only mode  To gain access to create/edit Zendesk tickets functionality directly from Microsoft Dynamics CRM, these users must have a valid Zendesk liecense and enter their own personal Zendesk credentials on the ZD Personal Settings page.
  • Zendesk administrator – grants access to the global Zendesk Settings page and the Zendesk Entity mappings .  Have full access to create/edit Zendesk tickets directly from Microsoft Dynamics CRM.

By default, all users can view Zendesk ticket information in Microsoft Dynamics CRM if the panels are enabled.

To enable the roles, do the following:

  1. In Microsoft Dynamics CRM, select Settings System Administration Users .
  2. In the Users page, click New if you need to add new users. 
    If you are editing a list of existing users, select the user you want to modify and click on the Manage Roles button.
  3. In the Add Users dialog box, select the role for the group you want to configure. 
    The two new roles created by the Zendesk integration are at the bottom. Click Next to select and assign the users to a particular role and to send email invitations.  Make sure you give yourself the Zendesk administrator role for now so you can complete the setup.

Users are now configured to use the Z endesk for Microsoft Dynamics CRM integration!  If you have pre-existing users, you can simply add the appropriate roles to each of your uses.

Note: For users with the Zendesk – Read configuration settings permission, they can individually add their own credentials by navigating to Settings->ZD Personal Settings in Microsoft Dynamics and clicking the New button to add credentials. Enter the Zendesk User ID andPassword then save the record and it will be applied when they access Zendesk tickets. The password will be encrypted so others cannot see the value. 
Part3-4.png

Microsoft.Crm.CrmException: Database having version 7.0.1.129 is not supported for upgraded Microsoft.Crm.CrmException: Database having version 7.0.1.129 is not supported for upgraded.

When upgrading from CRM 2013 to CRM 2015 you get an error: Microsoft.Crm.CrmException: Database having version 7.0.1.129 is not supported for upgraded.

Cause:

This is usually because there is already a database that exists with the same ID. You will need to delete that Organisation in CRM deployment manager before upgrading the new organisation from the same name.

Microsoft CRM IFD Event 364 and 111 in ADFS

Microsoft CRM IFD Event ID 364 and 111

We got the ADFS login screen as expected, but on trying to login we received an error:

  • Activity ID: 00000000-0000-0000-0400-0080020000f4
  • Relying party: CRM IFD Relying Party

Screenshot 2016 01 11 19 45 56

Associate with two errors in the ADFS Event Log.

Event ID: 111

Additional Data 
Exception details: 
System.ArgumentException: ID4216: The ClaimType ‘* Name’ must be of format ‘namespace’/’name’.
Parameter name: claimType
at Microsoft.IdentityModel.Threading.AsyncResult.End(IAsyncResult result)
at Microsoft.IdentityModel.Threading.TypedAsyncResult`1.End(IAsyncResult result)
at Microsoft.IdentityModel.SecurityTokenService.SecurityTokenService.EndIssue(IAsyncResult result)
at Microsoft.IdentityServer.Web.WSTrust.SecurityTokenServiceManager.Issue(RequestSecurityToken request, IList`1& identityClaimSet)

 Event ID: 364

Encountered error during federation passive request.

Additional Data

Protocol Name: 
wsfed

Relying Party: 
https://crm2016.iwebscrm16.com:444/

Exception details: 
Microsoft.IdentityServer.RequestFailedException: MSIS7012: An error occurred while processing the request. Contact your administrator for details. —> System.ArgumentException: ID4216: The ClaimType ‘* Name’ must be of format ‘namespace’/’name’.
Parameter name: claimType
at Microsoft.IdentityModel.Threading.AsyncResult.End(IAsyncResult result)
at Microsoft.IdentityModel.Threading.TypedAsyncResult`1.End(IAsyncResult result)
at Microsoft.IdentityModel.SecurityTokenService.SecurityTokenService.EndIssue(IAsyncResult result)
at Microsoft.IdentityServer.Web.WSTrust.SecurityTokenServiceManager.Issue(RequestSecurityToken request, IList`1& identityClaimSet)
at Microsoft.IdentityServer.Web.Protocols.PassiveProtocolHandler.SubmitRequest(MSISRequestSecurityToken request, IList`1& identityClaimCollection)
at Microsoft.IdentityServer.Web.Protocols.PassiveProtocolHandler.RequestBearerToken(MSISRequestSecurityToken signInRequest, Uri& replyTo, IList`1& identityClaimCollection)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.RequestBearerToken(MSISSignInRequestMessage signInRequest, SecurityTokenElement onBehalfOf, SecurityToken primaryAuthToken, SecurityToken deviceSecurityToken, String desiredTokenType, WrappedHttpListenerContext httpContext, Boolean isKmsiRequested, Boolean isApplicationProxyTokenRequired, MSISSession& session)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.BuildSignInResponseCoreWithSerializedToken(MSISSignInRequestMessage wsFederationPassiveRequest, WrappedHttpListenerContext context, SecurityTokenElement signOnTokenElement, Boolean isKmsiRequested, Boolean isApplicationProxyTokenRequired)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.BuildSignInResponseCoreWithSecurityToken(WSFederationSignInContext context, SecurityToken securityToken, SecurityToken deviceSecurityToken)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.BuildSignInResponse(WSFederationSignInContext federationPassiveContext, SecurityToken securityToken, SecurityToken deviceSecurityToken)
— End of inner exception stack trace —
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.BuildSignInResponse(WSFederationSignInContext federationPassiveContext, SecurityToken securityToken, SecurityToken deviceSecurityToken)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.Process(ProtocolContext context)
at Microsoft.IdentityServer.Web.PassiveProtocolListener.ProcessProtocolRequest(ProtocolContext protocolContext, PassiveProtocolHandler protocolHandler)
at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)

System.ArgumentException: ID4216: The ClaimType ‘* Name’ must be of format ‘namespace’/’name’.
Parameter name: claimType
at Microsoft.IdentityModel.Threading.AsyncResult.End(IAsyncResult result)
at Microsoft.IdentityModel.Threading.TypedAsyncResult`1.End(IAsyncResult result)
at Microsoft.IdentityModel.SecurityTokenService.SecurityTokenService.EndIssue(IAsyncResult result)
at Microsoft.IdentityServer.Web.WSTrust.SecurityTokenServiceManager.Issue(RequestSecurityToken request, IList`1& identityClaimSet)
at Microsoft.IdentityServer.Web.Protocols.PassiveProtocolHandler.SubmitRequest(MSISRequestSecurityToken request, IList`1& identityClaimCollection)
at Microsoft.IdentityServer.Web.Protocols.PassiveProtocolHandler.RequestBearerToken(MSISRequestSecurityToken signInRequest, Uri& replyTo, IList`1& identityClaimCollection)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.RequestBearerToken(MSISSignInRequestMessage signInRequest, SecurityTokenElement onBehalfOf, SecurityToken primaryAuthToken, SecurityToken deviceSecurityToken, String desiredTokenType, WrappedHttpListenerContext httpContext, Boolean isKmsiRequested, Boolean isApplicationProxyTokenRequired, MSISSession& session)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.BuildSignInResponseCoreWithSerializedToken(MSISSignInRequestMessage wsFederationPassiveRequest, WrappedHttpListenerContext context, SecurityTokenElement signOnTokenElement, Boolean isKmsiRequested, Boolean isApplicationProxyTokenRequired)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.BuildSignInResponseCoreWithSecurityToken(WSFederationSignInContext context, SecurityToken securityToken, SecurityToken deviceSecurityToken)
at Microsoft.IdentityServer.Web.Protocols.WSFederation.WSFederationProtocolHandler.BuildSignInResponse(WSFederationSignInContext federationPassiveContext, SecurityToken securityToken, SecurityToken deviceSecurityToken)

ADFS EVENT 111

The Fix: 

This was caused because we initially had the Transform of Windows Account Name to Name was initially set as * Name rather than just Name. So we updated it (and the instructions above to allow people to not experience this problem.

Update the Relying Party Trusts / Edit Claim Rules / Transform Windows Account Name to Name – Change the name value form * Name to Name

Name to Name

Restart ADFS Service and IIS. And you should resolve these errors.

Update ADFS SSL Certificates Microsoft CRM 2013 2015 and 2016 IFD

How to Update SSL Certificates for AD FS 3.0 in CRM IFD

Introduction

Microsoft Dynamics CRM can be configured to use SSL (Secure Sockets Layer). For this to work, an SSL certificate is required.

Certificates can be purchased from certificate providers and will expire after a certain period of time. Once this time has elapsed, Microsoft Dynamics CRM will no longer work until the certificate is updated.

This article describes the process to update the certificate for Microsoft Dynamics CRM

Installing the new certificate

You will need to import your certificate into the local certificate store on each CRM server that uses web services, and the AD FS server if claims-based authentication is enabled.

CertificateStore

Instructions on how to import a certificate can be obtained from your certificate provider.

Note: Problems may occur if you do not remove the old certificate.

Add permission to the certificate

It is necessary to grant specific permissions to the certificate to allow service accounts access.

Manage Private Keys

The following steps show how to add permissions to the certificate.

  1. Open the Certificate Console on the server.
  2. Check out the Microsoft Wiki for help
  3. Navigate to (Local Computer) > Personal > Certificates
  4. Right click the new certificate. Go to All Tasks > Manage Private Keys
  5. Add following permissions
    • AD FS Server: CRMAppPool Account = “Read”
    • AD FS Server: ADFSAppPool Account = “Full”
    • CRM Server: CRMAppPool Account = “Read”
    • In our case we were using the NETWORK SERVICE account and need to add the Read permissions
       Screenshot 2016 07 07 23 39 44

Update IIS (Internet Information Services) to use the new certificate

On the Microsoft Dynamics CRM website, the certificate bindings will need to be updated.

IIS Select Certificate

The following steps show how to bind the new certificate using IIS 8.

  1. Log on to the Microsoft Dynamics CRM Server.
  2. Open IIS.
  3. Locate the Microsoft Dynamics CRM website.
  4. Right click the website and click Edit Bindings.
  5. Select HTTPS and click Edit….
  6. Select the new certificate and click OK to save the settings.
  7. Close all open windows.

Reconfigure Claims-Based Authentication

The Microsoft Dynamics CRM application will need to be updated to use the new certificate.

Claims Setting

The following steps show how to reconfigure claims-based authentication.

  1. Open Deployment Manager
  2. Click Configure Claims-Based Authentication to open the wizard
  3. Click Next on the Welcome page
  4. Click Next on the Token Service page
  5. Select the new certificate on the Select Certificate page
  6. Click Next to complete the configuration

Update AD FS (Active Directory Federation Services)

In AD FS, the Service Communication certificate will need to be updated.

ADFS Certificate

The following steps show how to update the Service Communication certificate in AD FS 2.0.

  1. Open AD FS 2.0
  2. Navigate to AD FS 2.0 > Service > Certificates
  3. Click Set Service Communications Certificate
  4. Select the certificate and click OK

Update Relying Party Trusts

The Relying Party Trusts in the AD FS Management needs to be checked that the Relying Party Trusts are not showing an ! next to the listed Claims Relying Party Trust and the IFD Relying Party.

If they are, or even just to be safe. Click on each separately and the “Update from Federation Meta Data”

Screenshot 2016 07 07 23 43 26

Once these have both been updated you can move onto the last task.

Final Tasks

To finish the process, all affected services will need to be restarted.

IISRESET

The following steps should be completed once the certificate has been updated.  It may also be necessary to follow these steps if problems occur during any of the previous tasks.

  • Perform an IISRESET on each server
  • Restart the AD FS service on AD FS server
  • Update Relying Party metadata
    1. Open AD FS 2.0
    2. Navigate to AD FS 2.0 > Trust Relationships > Relying Party Trusts
    3. Right click each relying party and select Update from Federation Metadata
    4. Click Update

Microsoft CRM 2013 or 2015 Event ID 1309 ADFS IFD Resolution

When attempting to login to an IFD deployment of CRM 2013 or 2015 you receive an event Error: 1309 looking like this:

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 7/01/2016 12:08:14 AM
Event time (UTC): 6/01/2016 1:08:14 PM
Event ID: 0daeff15a8f24e939623db80c40522d5
Event sequence: 3
Event occurrence: 2
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/2/ROOT-1-130965592186041416
Trust level: Full
Application Virtual Path: /
Application Path: C:\Program Files\Microsoft Dynamics CRM\CRMWeb\
Machine name: VSERVER07

Process information:
Process ID: 2300
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: SecurityTokenException
Exception message: ID4175: The issuer of the security token was not recognized by the IssuerNameRegistry. To accept security tokens from this issuer, configure the IssuerNameRegistry to return a valid name for this issuer.
at Microsoft.IdentityModel.Tokens.Saml11.Saml11SecurityTokenHandler.CreateClaims(SamlSecurityToken samlSecurityToken)
at Microsoft.IdentityModel.Tokens.Saml11.Saml11SecurityTokenHandler.ValidateToken(SecurityToken token)
at Microsoft.IdentityModel.Tokens.SecurityTokenHandlerCollection.ValidateToken(SecurityToken token)
at Microsoft.IdentityModel.Web.TokenReceiver.AuthenticateToken(SecurityToken token, Boolean ensureBearerToken, String endpointUri)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequest request)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args)
at Microsoft.Crm.Authentication.Claims.CrmFederatedAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Request information:
Request URL: https://auth.iwebscrm.com:444/default.aspx
Request path: /default.aspx
User host address: 58.175.75.97
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 29
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: True
Stack trace: at Microsoft.IdentityModel.Tokens.Saml11.Saml11SecurityTokenHandler.CreateClaims(SamlSecurityToken samlSecurityToken)
at Microsoft.IdentityModel.Tokens.Saml11.Saml11SecurityTokenHandler.ValidateToken(SecurityToken token)
at Microsoft.IdentityModel.Tokens.SecurityTokenHandlerCollection.ValidateToken(SecurityToken token)
at Microsoft.IdentityModel.Web.TokenReceiver.AuthenticateToken(SecurityToken token, Boolean ensureBearerToken, String endpointUri)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequest request)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args)
at Microsoft.Crm.Authentication.Claims.CrmFederatedAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

UPDATE

On later version of CRM like CRM 2016 SP1 and using ADFS 3. This error appeared differently. We blogged this here: http://www.interactivewebs.com/blog/index.php/crm/microsoft-crm-ifd-the-ssl-certificate-does-not-contain-all-upn-suffix-values-that-exist-in-the-enterprise-cannot-login/

The cause

This is likely happening after updating the ADFS Token Signing Certificates in an IFD deployment of Microsoft CRM Server. In our case we had recently updated the ADFS signing certificate using the PowerShell command:

Update-AdfsCertificate -CertificateType Token-Decrypting -Urgent
Update-AdfsCertificate -CertificateType Token-Signing -UrgentSet-ADFSProperties -AutoCertificateRollover $false 

After doing that we found that the IFD deployment would not allow login to the CRM server for external users, with the above error being logged.

The Fix

Microsoft Dynamics CRM error: The issuer of the security token was not recognized by the IssuerNameRegistry – Solved

“The issuer of the security token was not recognized by the IssuerNameRegistry. To accept security tokens from this issuer, configure the IssuerNameRegistry to return a valid name for this issuer.”
Or…

adfs1

If your Microsoft Dynamics CRM users are seeing the above errors when attempting to log-in, you may have an ADFS Certificate issue. ADFS generates new certificates about a month prior to certificate expiration, however, Dynamics CRM does not recognize them until you take a few steps to resolve the issue.

To locate your ADFS Certificates, navigate to the ADFS Console. Under “Service”, click on “Certificates”, where you will find a Primary and Secondary certificate. If the current date is close to the date of your Primary certificate “Effective Date”, it’s safe to assume that this is the underlying issue.

adfs2

To resolve this issue:

1. Navigate to the ADFS Console >> Trust Relationships >> Relying Party Trusts.
2. Right click on the trust and select “Update from Federation Metadata…”
a. If there are two trusts, do them both. This may be a case where you have one for Internal and External.

adfs3

3. Open Command Prompt. Be sure to right-click and “Run as Administrator”.
a. From within CMD, type “iisreset”.

adfs4

4. Open “Services” and restart the “ADFS” service.

adfs5

a. If ADFS does not start, be sure to check the “Windows Internal Database” service and make sure it is started, and then try restarting the ADFS service.

If these initial steps do not resolve your issue for any reason, continue with the following steps below:

5. Navigate to “CRM Deployment Manager”.
a. Run “Configure Claims-Based Authentication” wizard, upper right hand corner.
b. Click “Next” all the way through the wizard, nothing needs to be changed here.

adfs6

6. Run “Configure Internet Facing Deployment” wizard.
a. Click “Next” all the way through the wizard, nothing needs to be changed here either.

adfs7

7. Now, perform Steps 1-4 again as outlined above.
a. Update Federation Metadata
b. IISReset
c. Restart ADFS Service

Your users should be able to log-in to Dynamics CRM again. I hope you find this helpful and that it resolved your issue.

Zendesk to CRM 2015 and Microsoft Dynamics 365 Integration

Installing the Zendesk to CRM 2015 or Dynamics 365 integration

These instruction have been updated from the Zendesk instructions provided here: https://support.zendesk.com/hc/en-us/articles/203660156-Zendesk-for-Microsoft-Dynamics-CRM-Part-1-Installing-the-Zendesk-for-Microsoft-Dynamics-CRM-as-a-module-in-Microsoft-Dynamics-CRM

 

They use a combination of the original processes that Zendesk have created originally for CRM 2011 and that worked on Pre SP1 versions of CRM 2013. The packages referenced have been update by InteractiveWebs to work with CRM 2013 Post SP1 and CRM 2015 (technically all versions but we recommend post SP 0.1)

 

Instillation of the CRM Solution

Install the CRM Managed Solution as you would any other CRM solution.

Download the managed solution for CRM 2015 https://www.dropbox.com/s/0rhlgnxcwz9s4yh/ZendeskDynamicsCRMConnector_2_0_0_2_managed.zip?dl=0

In CRM Navigate to SETTINGS / SOLUTIONS

Click on Import

Screenshot 2015 06 18 17 45 23

Chose File

Screenshot 2015 06 18 17 47 09

 

Select the Managed CRM package – Click Next

Screenshot 2015 06 18 17 49 51

Click Next

Screenshot 2015 06 18 17 51 30

 

Leave the Enable any SDK ticked, and click on Import

Screenshot 2015 06 19 23 39 37

 

Allow the Import to take place

Screenshot 2015 06 19 23 40 43

 

Click on Close

Screenshot 2015 06 19 23 42 16

 

On Completion, Click “Publish All Customisations”.

Screenshot 2015 06 19 23 43 04

 

Update Security Roles

In the CRM menu, select Settings / Security

Screenshot 2015 06 19 23 45 15

 

Select the User that you wish to use to bring in Zendesk Integration Items. We are using in this example the Administrator account, but it could be anyones account.

Then with the account loaded, select the additional item dropdown menu to the far right of the top level menu, selecting Manage Roles

Screenshot 2015 06 19 23 48 51

 

Select Zendesk Administrator

Screenshot 2015 06 19 23 50 18

There is also a Zendesk Read configuration setting. The Zendesk support site has details on how this can be used.

 

 

 

Screenshot 2015 06 19 23 47 22

Double Click on that name to load the account.

 

Configure Entity Mapping

In your browser, click on Refresh to reload the CRM page, and in turn the top level menu that has been updated after import for the Zendesk Solution.

In the CRM system, select Settings / Zen Entity Mappings

Screenshot 2015 06 19 23 54 49

 

Click + New

Screenshot 2015 06 19 23 55 47

 

The most typical setups are things like on a “Contact” entity, match the Zendesk ticket requester with the email address on the “Contact” record. But what if you wanted to match of the “Full Name” field instead in both systems?  Now you can by utilizing entity mappings.

 

  • Select the following items

    • Entity Name – This is the Microsoft Dynamics entity that you want the mapping applied to.
    • Zendesk Object – This is where you can select which object from Zendesk you’d like to pick your field from.
    • Zendesk Field – This will populate with values depending on your selection from Zendesk Object.
    • Entity Field – This is a list of fields associated to the selected Entity Name.  Pick which field you want to match to the Zendesk Field.Click “Save” to store the mapping. 
  • Click the ZD Entity Mapping tile to return to the page. 
  • Repeat steps 1-5 if you wish to add more mappings for additional Entities..

 

Here’s a list of the most common types of mappings:

 

  • Account/Organization Entity
    • Entity Name: “Account” or “Organization”
    • Zendesk Object: Organization
    • Zendesk Field: Name
    • Entity Field: Account Name
    • Contact/Lead Entity
      • Entity Name: “Contact” or “Lead”
      • Zendesk Object: User
      • Zendesk Field: EmailAddress
      • Entity Field: EmailAddress 1


 

Configure Zendesk Settings Page

In CRM Navigate to Settings / ZD Settings (Note that this one is not the ZD Personal Settings Menu Item).

NOTE – This works best in Chrome – We found troubles with IE and Safari (not our work)!

 

Screenshot 2015 06 20 00 11 05

You now need to set up your Zendesk credentials so that the system can authenticate to the appropriate Zendesk instance.

To do so, navigate to Settings, then locate the Zendesk Settings->Settings title and click the title.

You will be presented with 4 sections:

  • Ticket view defaults  – global default settings for ticket views in the Zendesk ticket panel. 
    This sets the defaults at the account level, but can be overwritten by individual preferences by each user.
  • Filtering – sets the default values for filters in the Zendesk ticket panel.
  • Sorting – sets the default sort order for tickets in the Zendesk ticket panel.
  • Authentication – enter your Zendesk subdomain (make sure you specify HTTP vs. HTTPS if you have SSL enabled) and login credentials (you need administrator credentials). 
    This gives your Microsoft Dynamics CRM users read-only access to available tickets. To create or edit tickets from Microsoft Dynamics CRM, your Dynamics users must have a Zendesk license, and they will need to enter their own credentials (explained later in this article).  
  • Mapped record types – enables you to modify the data elements that display in a Zendesk user profile when a ticket is loaded. 
    You can choose from LeadContact, and Account. All fields are available, including custom fields.
  • Ticket-to-case mapping – identifies data items that should be mapped from standard Zendesk ticket fields into Microsoft Dynamics CRM cases. 
    The three Zendesk fields that are supported are StatusPriority, and Type.

 

Add Zendesk Ticket Grid

Now you are ready to add the Zendesk ticketing panel to any of the entity pages that you’ve configured mappings for. You need to repeat the steps below for each entity type you want the ticketing grid displayed on.

  1. In Microsoft Dynamics, navigate to the first entity where you want to add the ticketing grid. 
    For this example, we’ll refer to a Contact record.
  2. Select any contact in your list and navigate to the Form Editor.
  • In Dynamics 2015, highlight the More (…) tab(1) and select the option for Form(2) to start the form editor.Form2013-1.png
  • In Dynamics 2011, navigate to the Customize (1) tab and click on Form (2)Form2011-1.png
  • In the Form Editor, click the Insert tab (1), then click the Web Resource button (2).Form2013-2.png
  • In the Add Web Resource page, click the magnifying glass next to Web resource to find the Zendesk ticket grid (zd_/Pages/TicketGrid/TicketGrid.html).Form2013-3.png
  • In the next page, select the check box next to zd_/Pages/TicketGrid/TicketGrid.html, then click OK.
  • Back in the Add Web Resource dialog box you should see zd_/Pages/TicketGrid/TicketGrid.html in the Web resource field. Enter a Name and Label you can easily recognize (consider naming it Zendesk Ticket Panel). Check the box for Pass record object-type code and unique identifier as parameters.  
    Form2013-4.png
    Click OK. 
  • ou now have a Zendesk ticket panel in the form layout that you can drag anywhere you’d like on the page. You can even create a special subsection for it if you’d like.
  • After you place the panel, navigate to the Home tab, click Save, then click Publish
  • Refresh the contact page you had open and you should see the new Zendesk ticket panel where you placed it!  Form2013-5.png
  •  Repeat these steps for any other entities you have created mappings for.

 

Configuring InteractiiveWebs Zendesk to CRM 2015 or Dynamics 365 Web Service

Next you need to enable your CRM instance to use the InteractiveWebs Web Service that will connect Zendesk to your CRM instance either in the cloud, IFD or on premises.

If you have an IFD instance or a Microsoft Hosted Cloud

instance of CRM then go here: http://www.interactivewebs.com/Admin/Zendesk/tabid/3566/Default.aspx

If you have never registered with InteractieWebs then click on “Subscribe Now”

 Screenshot 2015 06 20 19 08 05

Fill in the form with the following details.

Username: Select a user name to use with our website.

Password: Select a password to use on our website

Email: Be sure to use a valid email address. We will not share or spam you, but for services we need this to be accurate.

First Name: Your First Name

Last Name: Your Last Name

CRM Address: This is the address of your CRM server in the following format: e.g.. https://contoso.hostedcrm.com:444/  You type “contoso.hostedcrm.com” (without the  “ “ ).

CRM Organization: You administrator can help with this, but in the example above it is “contoso” and is usually the word before the domain of your hosting environment.

You can contact us on the help link at the bottom of the page if you are not sure what you should type here.

Screenshot 2015 06 20 19 15 01

 

If you have an on premises CRM solution

you will need a custom version of the web service to host on your own servers. Contact us at our website: http://www.interactivewebs.com/ContactUs/tabid/55/Default.aspx

and advise that you are after a custom web service for Zendesk to CRM 2015 integration. Advise us of:

1. The URL you use to access your CRM internally.

2. The Organisation name you use in CRM.

We can then provide you with a custom web service for $200 one off fee with no expiry date on the web service.

 

Zendesk Setup – Display of CRM Data

It is possible to display the user data from Microsoft CRM in the Zendesk tickets. To do this:

1. In Zendesk select Admin

2. Select Apps / Market Place and search the words – “Microsoft Dynamics”

3. Install the App – Microsoft Dynamics

Screenshot 2015 09 15 04 27 23

Under Manage – you should see the app installed:

Screenshot 2015 09 15 04 28 09

Installing this will allow you to select the “User Data Lookup” Feature that is explained in the next section below.

Screenshot 2015 09 15 04 29 03 – Found in the Extensions / CRM in Zendesk.

 

Setup Zendesk Settings

Now you will need to set up the Zendesk side of the integration.

To do this, you login to your Zendesk interface and Admin / Extensions 

Screenshot 2015 06 21 09 12 10

In Extensions you select CRM

Select Microsoft Dynamics CRM 2011 (For all versions of CRM including Dynamics 365)

Screenshot 2015 09 15 04 30 17

Select your hosting type

Screenshot 2015 09 15 04 30 36

If you have IFD or Microsoft Cloud Hosted Solution, select Cloud or IFD respectively

FOR CRM versions before Dynamics 365 (up to CRM 2016 pre SP1)

For the Web Service (having subscribed to the service) put in:

https://zendesk.interactivewebs.com  (note that this will only work if you have subscribed)

Screenshot 2015 09 15 04 31 03

For Dynamics 365 (or CRM versions after CRM 2016 SP1)

Because the SDK was updated for Dynamics 365 we have created a web service URL unique for later versions of Dynamics 365. Use the

URL: https://zendesk365.interactivewebs.com (note that this will only work if you have subscribed)

 

If you have an on-premise then select that and put in the URL of your web service that was supplied to you after contact InteractiveWebs for a custom solution.

All the other data for that page is per the instructions and help provided by Zendesk in their help pages found here: 

https://support.zendesk.com/hc/en-us/articles/203660186-Zendesk-for-Microsoft-Dynamics-CRM-Part-3-Setting-up-the-Zendesk-App-and-Ticket-to-Case

 

 

Support

If you have problems or questions, please feel free to contact us at: http://www.interactivewebs.com – We have a range of other integration products, including website to CRM integrations for forms, billing, kb, support and more.

 

 

Microsoft CRM Solution Import Fields that are not valid were specified for the entity

While importing a solution to CRM 2011, CRM 2013, or CRM 2015 you receive an error 

Fields that are not valid were specified for the entity

 

The Cause

The cause of this is likely that one of the attributes that you are importing (from a dev environment) already exists in the CRM instance, but with a different attribute.

For Example:

  • In your Live Environment
  • Within Accounts, you create a new attribute called “Friendly Cusomter” and mark it TEXT 
  • Publish and all is well and good.
  • In you Dev Environment
  • Within Accounts, you create a new attribute called “Friendly Customer” and make it a PICK LIST

 

in other words, the same name for the attribute, but a different kind of field.

Then try to export from DEV and import to LIVE. You get the error.

 

The solution

You have to remove the conflicting fields from the destination (live in the example above) CRM system.

Microsoft gives you some help here, in the form of an XML dump file. What you need to do is open that file in something like DreamWeaver that has the ability to apply “Source Formatting”. This makes the file pretty to read. 

From

Ugly XML Dump file from CRM.png

To

CRM xml dump file in DreamWeaver.png

Then do a search for the text “errortext” and start clicking next / next till you get to some text with an attribute and an error message. 

In our case:

Screenshot 2015 04 29 21 52 24

<Cell ss:StyleID=”s137″ name=”ErrorText”>
<Data ss:Type=”String”>Attribute new_leasecustomer is a Picklist, but a Boolean type was specified.</Data>
</Cell>

This gives the name of the attribute at fault.

<Cell ss:StyleID=”s137″ name=”ErrorText”>
<Data ss:Type=”String”>Attribute new_leasecustomer is a Picklist, but a Boolean type was specified.</Data>
</Cell>

And the error on the import will tell you the Entity that it failed the import on. Again in this case it was the ACCOUNT entity.

So we just removed that attribute from any forms and views, then deleted the attribute (be sure that your live data is not relying on data entered here by users as you will loose it). Publish the entity. Then test the import again.