Quantcast
Channel: Dynamics 365 Customer Engagement in the Field
Viewing all 103 articles
Browse latest View live

CRM 4.0 Outlook Client Error Message: Action Microsoft.Crm.Config.Client.InstallPstAction failed

$
0
0

If you've had the CRM 2011 Outlook client installed and decide to uninstall and install the CRM 4.0 Outlook client, you may run into the following error message (from the config log) when configuring the CRM 4.0 Outlook client:

Error| Configuration exception.System.Exception: Action Microsoft.Crm.Config.Client.InstallPstAction failed. ---> System.Runtime.InteropServices.COMException (0x8004010F): LaunchOutlookInstallerProcess failed.

If you find yourself in this scenario, it may be because the CrmForOutlookInstaller version is currently incorrect.  You can find the file at:
C:\Program Files (x86)\Microsoft Dynamics CRM\Client\ConfigWizard

If you have the 4.0 client installed, the 4.0 version needs to be in place.  There are situations where the 2011 version might be left over from a prior 2011 Outlook client install. 

To fix, you can copy the 4.0 CrmForOutlookInstaller version from the folder where you extracted the Outlook client install:
C:\extract location folder name\\pfiles\mscrm\client\configwizard
and replace the file in the program files location:
C:\Program Files (x86)\Microsoft Dynamics CRM\Client\ConfigWizard

Hope this saves you some headaches.

- Jon

 


Error message “Assembly must be registered in isolation” when registering Plugins in Microsoft Dynamics CRM 2011

$
0
0

I had a customer run into the error message“Assembly must be registered in isolation” when trying to register a CRM 2011 plugin. We found this error was being thrown because the user was not a deployment administrator.  If the user is only a System Administrator in the organization, they will be forced to register plugins in the sandbox isolation mode.  After adding the user as a deployment administrator he was able to register the plugin to database without any issues.

In the Security Restrictions section of the following MSDN article it states, “There is a security restriction that enables only privileged users to register plug-ins. For plug-ins that are not registered in isolation, the system user account under which the plug-in is being registered must exist in the Deployment Administrators group of Deployment Manager.“ 

Register and Deploy Plug-ins
http://msdn.microsoft.com/en-us/library/gg309620.aspx

Generic Error

image

Detailed Error

image

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Action failed for assembly 'SamplePlugins, Version=0.0.0.0, Culture=neutral, PublicKeyToken=829f574d80e89132': Assembly must be registered in isolation.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ErrorCode>-2147220906</ErrorCode>
  <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Action failed for assembly 'SamplePlugins, Version=0.0.0.0, Culture=neutral, PublicKeyToken=829f574d80e89132': Assembly must be registered in isolation.</Message>
  <Timestamp>2011-08-17T19:15:20.1988144Z</Timestamp>
  <InnerFault>
    <ErrorCode>-2147220906</ErrorCode>
    <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>Action failed for assembly 'SamplePlugins, Version=0.0.0.0, Culture=neutral, PublicKeyToken=829f574d80e89132': Assembly must be registered in isolation.</Message>
    <Timestamp>2011-08-17T19:15:20.1988144Z</Timestamp>
    <InnerFault i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <TraceText i:nil="true" />
</OrganizationServiceFault>

Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Xrm.Sdk.IOrganizationService.Create(Entity entity)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.CreateCore(Entity entity)
   at PluginRegistrationTool.RegistrationHelper.RegisterAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly) in C:\Users\jemorl\SDK\CRMSDK 2011\tools\pluginregistration\RegistrationHelper.cs:line 227
   at PluginRegistrationTool.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e) in C:\Users\jemorl\SDK\CRMSDK 2011\tools\pluginregistration\PluginRegistrationForm.cs:line 461

Reminders not working with Outlook 2010 SP1 and CRM 2011–Fix Available

$
0
0

I recently received a new laptop from Microsoft, all pre-loaded and ready to use.  I configured Outlook, configured CRM, restored some files and started to use my new machine.  However, I had one very pesky issue with my laptop, I noticed that none of my Outlook reminders were working.  So, I started to tinker, I created an appointment in the past and nothing happened, I ran the outlook process with the /cleanreminders switch and no change, I even downloaded MFCMapi and dug through the reminders table thinking that I may find some clues there.  At that time, it didn’t occur to me that this could possibly be related to CRM. I searched Bing and other popular search engines but the results were all over the map, then a coworker suggested I search the newly updated http://support.microsoft.com (why didn’t I think of that)?  I searched “Outlook reminders not showing”.  As I was reading the third result: KB article #2586274), I was thinking to myself “I don’t have SP1 installed so this can’t be the problem…” but then it dawned on me: my new laptop came preloaded with Office 2010 SP1 – something I had not yet installed on my previous laptop. 

To sum things up: if you also have Office 2010 with SP1 installed and are using the CRM 2011 client be sure to install the August update to Outlook to avoid missing any important reminders. 

Thanks for reading!

Sean

Error when installing CRM 2011 on a new server that's part of a Network Load Balancing IFD environment

$
0
0

One of my customers has a CRM 2011 IFD (Internet Facing Deployment) on a NLB (Network Load Balancing) environment. IFD and NLB were setup and configured correctly. The customer wanted to install a new CRM 2011 server and add it to the NLB enviornment.

When installing CRM 2011 on the new server we got the following error -

The encryption certificate 'CN=*.contonso.com, OU=Domain Control Validated, O=*.contoso.com' cannot be accessed by the CRM service account

This error is misleading as you think it’s something to do with the Wildcard certificate missing or not being configured correctly on the Default Website of the new server that we were installing CRM.

To resolve this issue, we performed the following steps to install CRM 2011 on the new server -

  • Disable IFD
  • Disable Claims
  • Install CRM 2011 on the new server
  • Enabled Claims
  • Enabled IFD

 

Caveats of Setting the Maximum File Size limits for attachments in CRM 2011

$
0
0

CRM 2011 has a configurable setting where you can set the “Maximum file size limit for attachments”. This is under the Email tab of the System Settings (see screenshot below).

 

 Although this setting is under the Email tab of System Settings, it limits the size of files for the following –

  • File attachments of email messages
  • File attachments of Notes
  • Web Resources

If you set the Maximum file size to 0, it will restrict you from:

  • Promoting emails with attachments to CRM
  • Uploading attachments (to the Notes entity) in CRM
  • Errors when trying to create a Web Resource
  • Error when importing a Solution that contains a Web Resource. You will get an error that says “Web Resource content size is too big”

Per this MSDN article (http://msdn.microsoft.com/en-us/library/8c947e83-6765-41d9-b4b7-c078a68257eb), here is a brief description of this setting –

The maximum size of files that can be uploaded is determined by the Organization.MaxUploadFileSize property. This property is set in the E-mail tab of the System Settings in the application. This setting limits the size of files that can be attached to email messages, notes, and Web resources. The default setting is 5MB.

ReportingAccountMemberOfSecurityGroupValidator Error When Installing CRM 2011 Reporting Extensions

$
0
0

I recenty worked through an issue where a customer was receiving the following error when attempting to install the CRM 2011 Reporting Extensions:

Check ReportingAccountMemberOfSecurityGroupValidator : Failure: A Microsoft Dynamics CRM Server component is using the same account as the instance of SQL Server Reporting Services.

This error can occur for a variety of reasons.  One reason can be related to the SQL Reporting Services service being started by a domain account that is a member of the SQLAccessGroup (this account does not need to be in the SQLAccessGroup).  The same situation could occur if the SQL Reporting Services service is starting with the Network Service account and the SQL Reporting Services server name is located within the SQLAccessGroup.  To get past this issue, you have two options:

  1. Remove the account from the SQLAccessGroup
  2. Use the IgnoreChecks registry key to get past this error message in the short term (specified in KB 974584).  It would be recommended to remove the account that is in the SQLAccessGroup at a later time.

There may be situations where the CRM server and the SQL Reporting Server are installed on the same physical server running under the same account.  Ideally, the services would be running under different accounts.  If the CRMAppPool and the SQL Reporting Services service are running under the same account (and that account is added to the SQLAccessGroup), you would receive a warning message rather than an error message. 

The reason that the error occurs is listed below:

Microsoft Dynamics CRM Reporting Extensions should not be installed on an instance of Microsoft SQL Server Reporting Services that is running under an account that is a member of the SQL Access Group.  This can occur when Microsoft SQL Server Reporting Services is running under the same account as a Microsoft Dynamics CRM Server 2011 component. This configuration can make the system vulnerable to certain attacks. During installation, Setup detects this scenario.

Thank you,

Jon

How to Decrease 401 Responses in CRM Web Traffic

$
0
0

When analyzing traffic from a web application such as CRM you may notice that many of the requests result in a 401 (Access Denied) before they get the 200 Success response. This is a normal authentication sequence for Kerberos or NTLM. Internet Explorer will first attempt anonymous access before any type of authentication attempts.

image

Some of the static objects such as graphics will allow anonymous access so the request immediately gets a 200 response. Other objects such as ASPX pages require authentication before the content is returned. In that case we have two round-trips before we get our data. This can result in many extra round trips to load an entire page. If the users are on a WAN or if there is high latency on the network the performance may be impacted. On some custom pages I have seen one 401 for every 200 which doubled the round-trips to load page.

IIS 6.0 and IIS 7.0 require the client to be reauthenticated for each HTTP request. This behavior causes network traffic to increase. The following KB articles describe fixes you can apply to change this behavior. When the fix is applied the client will authenticate on the first request and then remain authenticated for the remaining requests in that HTTP Keep-Alive session. This can greatly decrease the round-trips and amount of data being transferred.

You may experience slow performance when you use Integrated Windows authentication together with the Kerberos authentication protocol in IIS 6.0

http://support.microsoft.com/kb/917557

You may experience slow performance when you use Integrated Windows authentication together with the Kerberos authentication protocol in IIS 7.0

http://support.microsoft.com/kb/954873

In the following example the customer had a custom page displayed on their contact form. After applying the fixes the total round-trips decreased by 40%. Each environment is a little bit different, but there may be some performance gains found by testing these fixes.

Sample Results after Applying Changes from the KB:

BEFORE

AFTER

Percent Change

Request Count:                126

Request Count:                76

-40%

  

RESPONSE CODES

RESPONSE CODES

HTTP/200:           64

HTTP/200:           64

0

HTTP/401:           62

HTTP/401:           12

-81%

  

Please leave a comment if you found this post helpful.

 

Jeremy Morlock

Microsoft Premier Field Engineer

CRM 2011 Solution Import Fails with error “Object reference not set to an instance of an object” due to missing relationship “goal_DuplicateBaseRecord”

$
0
0

I had recently worked with a customer that was running into errors when trying to import a solution into some of their organizations. The solution import would fail with the following error message.

Entity Relationships        goal_DuplicateBaseRecord                Failure    0x80044150    Object reference not set to an instance of an object.

This goal_DuplicateBaseRecord relationship would exist in the source organization, but not the target organizations which caused this exception. We found that this relationship will be created if the duplicate detection had been toggled on and off within the goal entity. Once the relationship exists you will only be able to import that organizations solution into other orgs which the relationship exists.

After working with the support team we found that the goal_DuplicateBaseRecord relationship should exist on the Goal entity by default since it had Duplicate Detection enabled. This has been logged as an issue and will be fixed in one of the future updates.

 

If you are seeing this issue you can complete these steps to create the missing relationship.

1. Open the organization which you are getting the error message and go to Settings–Customizations-Customize the System.

2. Expand Entities and click on the Goal Entity.

3. Within the Goal properties UnSelect Duplicate Detection and Click Save.

image

4. Now Select Duplicate Detection to enable the feature and Click Save Again. This process will create the missing relationship to the DuplicateRecordBase table.

If you review the 1:N Relationships the missing relationships will now show up after the setting was toggled. You will now be able to import the solution without receiving the error message.

Before (Missing Relationships):

image

 

After (Relationships Created):

image

 

Please leave a comment if you found this post helpful and if it resolved the issue you were facing.

 

Thanks,

Jeremy Morlock

Microsoft Premier Field Engineer


Script Error “The system cannot find the file specified” when using Microsoft Dynamics CRM 2011.

$
0
0

I have worked with a couple customers lately that would receive a script error when opening and navigating around Microsoft Dynamics CRM 2011. The first sign of the issue was an “Error on Page” message on the bottom left hand corner of the IE window. When they would attempt to browse to another area or close the form the following “Microsoft Dynamics CRM has encountered an error” message was thrown.

image

 

To see details of the script error you are able to click the link “View the data that will be sent to Microsoft” and the details will be displayed in another window.  For this specific issue the following script error report was provided stating that “The system cannot find the file specified”.

<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
  <ScriptErrorDetails>
   <Message>The system cannot find the file specified.</Message>
   <Line>1</Line>
   <URL>/_static/_common/scripts/main.js?ver=-863096087</URL>
   <PageURL>/main.aspx?etc=2&extraqs=%3f_gridType%3d112%26etc%3d112%26id%3d%257b6VCED6531-C5W3-R083-A86T-015676G13257%257d%26rskey%3d949894547&pagetype=entityrecord</PageURL>
   <Function>anonymous($p0,$p1){try{if(!IsNull($p0)){var$v_0=String.format("Timestamp:Loaded={0},Updated={1},Saved={2}{3}{4}",this.$X_3.toString(),!IsNull(this.$J_3)?this.$J_3.toString():(newDate).toString(),!IsNull(this.$R_3)?this.$R_3.toString():"",this.$2_3,$p0);th</Function>
   <CallStack>
    <Function>anonymous($p0,$p1){try{if(!IsNull($p0)){var$v_0=String.format("Timestamp:Loaded={0},Updated={1},Saved={2}{3}{4}",this.$X_3.toString(),!IsNull(this.$J_3)?this.$J_3.toString():(newDate).toString(),!IsNull(this.$R_3)?this.$R_3.toString():"",this.$2_3,$p0);this.get_element().setAttribute(this.$P_3,$v_0)}}catch($$e_1_0){var$v_1=String.format("Timestamp:Loaded={0},Updated={1},Saved={2}{3}{4}",this.$X_3.toString(),this.$J_3.toString(),!IsNull(this.$R_3)?this.$R_3.toString():"",this.$2_3,$p1);this.get_element().setAttribute(this.$P_3,$v_1)}this.get_element().save("RVItems")}</Function>
    <Function>anonymous($p0){this.$X_3=this.$17_3;var$v_0=this.$g_3($p0);$v_0=this.$12_3($v_0);this.$G_3($v_0,$v_0);for(var$v_1=0;$v_1<this.$I_3.length;$v_1++){var$v_2=this.$I_3[$v_1];$v_2($v_0)}this.$I_3=newArray(0);return$v_0}</Function>
    <Function>anonymous($p0,$p1){var$v_0=null;if($p0.Success){$v_0=$p0.ReturnValue;this.$14_3($v_0)}this.$k_3=false}</Function>
    <Function>anonymous(){returnb.apply(a,arguments)}</Function>
    <Function>readyStateChanged()</Function>
   </CallStack>
  </ScriptErrorDetails>

 

After troubleshooting this issue we found that Microsoft Dynamics CRM 2011 is trying to write data to the Internet Explorer “UserData” folder which was missing in the users windows profile. If the folders are redirected before the user ever opens Internet Explorer the folder will not get pre-created. Once the profile is moved to the network share Internet Explorer is not able to create the folder any longer.  If the user has been in Internet Explorer prior to enabling folder redirection then the issue will not happen since the folder was pre-created.

We were also able to reproduce this issue outside of Microsoft Dynamics CRM 2011 by going to this URL and trying to save or load data. It will result in the same script error. http://samples.msdn.microsoft.com/workshop/samples/author/persistence/userData_1.htm

To resolve the issue the missing folder can be manually created in the users profile. Alternatively, a script such as the following could be executed to create this missing folder.

if not exist "%APPDATA%\Microsoft\Internet Explorer\UserData" md "%APPDATA%\Microsoft\Internet Explorer\UserData"

This type of script could be executed via the group policy to ensure the UserData folder exists for any new profiles that are created. Once the UserData folder is created Internet Explorer is able to write the necessary data.

Below is an example of the type of data you may find in the folder and subfolders.

image

image

 

If you are running into this issue or planning to deploy Microsoft Dynamics CRM 2011 in an environment with roaming profiles you will want to ensure this folder exists.  This could be a common scenario where Citrix is used to access Microsoft Dynamics CRM 2011.

The Internet Explorer team is investigating ways to prevent this from happening in the future, but for now this workaround can be used to prevent or resolve the issue.

Thanks,

Jeremy Morlock

Microsoft Premier Field Engineer

Viewing Detailed Errors for Failed Workflows in CRM

$
0
0

Recently one of my customers noticed some of their workflows were failing and had been failing for quite some time without knowing it. When looking at the failed workflow instance within System Jobs it only showed a generic error message that did not provide enough detail to troubleshoot with.  You could get detailed errors by gathering a server side platform trace, but the easiest ways to get the error details is to view the message attribute within System Jobs. The message attribute will contain a stack trace of the error that the workflow or system job had encountered.  Many times this attribute will provide all the detail you need for troubleshooting without having to gather any server side tracing. This attribute is not on the default System Jobs view, but it is very easy to create a personal view in Advanced Find to view this and monitor moving forward.  Below are the steps on creating the personal view and viewing the message attribute.

1. Open CRM Web Client and click Advanced Find.

2. Choose System Jobs from the Look For dropdown menu.
image

3. Click Show Details so we are able to add filter criteria
image

4. Add the filter criteria “Message Contains Data”. This way it will only return jobs that have encountered an error. You may also add another filter on status to only show those jobs in a waiting or failed status.
image

5. Click on the Edit Columns button so that we can add the message attribute to our view.
image

6. Click on the Add Columns button once the edit columns window opens. Then choose the Message attribute and click OK twice to get back to the main advanced find window.
image

7. Now that you have an advanced find view created for troubleshooting you can save this as a personal view. To save the view click on Save As in the toolbar, provide a name and click OK. Now this will show up in the system jobs view for future use.
image

8. Click on Find within the advanced find window to see the results.
image

9. Scroll to the far right to see the message column for any failed workflows.  You can also export the list to Excel and that will allow you to easily format, filter and search the results.
image

10. If you saved the view it will show up under the system jobs section. This will provide an easy way to watch for failing workflows and troubleshoot them without accessing the server.
image

 

By having a system jobs view that includes the message column it will help catch failing workflows faster and provide necessary data to troubleshoot the issue.

 

Thanks,

Jeremy Morlock

Microsoft Premier Field Engineer

Error Message “There is no such object on the server.” when using Microsoft Dynamics CRM rule deployment wizard with Exchange 2010

$
0
0

 

I recently worked with a customer that was receiving the error message “There is no such object on the server” every time they would attempt to verify, deploy, or remove a rule. This issue started happening as soon as they upgraded from Exchange 2007 to Exchange 2010. Below is a screenshot showing the specific error message. 

  image

When you attempt to verify, deploy, or remove rules with rule deployment wizard it will first make a LDAP request to pull properties for the users or queues. To see the exact LDAP queries being executed we used Network Monitor. On the effected environment we could see that the rule deployment wizard would first try querying for the administrator account before it would look at any of the actual users. In this particular environment the Administrator account had been renamed so the rule deployment wizard would fail with the “No Such Object” error message. Once it failed to find the Administrator account it would not proceed to look for the remaining accounts.

This behavior was now changed in recent update rollups so that it is no longer searching for the account “Administrator”. If you are receiving this error message or have renamed the Administrator account you will want to make sure most recent update rollups are applied to the rule deployment wizard.

image

image

 

Once we installed the latest update rollup the rule deployment wizard was able to successfully find the Active Directory properties. The AD properties are then passed as arguments to rules.exe which communicates with Exchange and modify the rules. Below we have used Process Monitor to see exactly which arguments are being passed to the rules.exe application.

image

Sample command sent to the rules.exe application

"Rules.exe" "/verify" "JEMORL98" "/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Configuration/cn=Servers/cn=JEMORL98/cn=Microsoft Private MDB" "/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Administrator" "/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=support q" "fmb@jemorl100dom.lab" "0" "1"

 

By using Network Monitor and Process Monitor we were able to track down the source of the issue and find the failing request. If you are running into other issues with the rule deployment wizard you may be able to use this troubleshooting process to narrow down the source of the issue.

 

Thanks,

Jeremy Morlock

Microsoft Premier Field Engineer

“Your organization is not ready yet” error when logging into CRM Online after creating a new organization

$
0
0

 

Dan Hamre on the CRM Support team recently shared some information with our team that I thought we be good to put out on our blog.

Issue: When attempting to sign into a newly provisioned CRM Online organization, users can sign in but then get the following error message. "Your organization is not ready yet”

clip_image001

Cause: The global Admin who provisioned the CRM organization has not logged into CRM yet to set the Base Currency.

Resolution: Have the administrator who started the CRM trial or subscription, log into CRM and go through the wizard which asks to set the default currency.  This will complete the setup process.

Why is this happening now: Some new customers are encountering this because the signup process does not automatically sign them into CRM as it did at the end of the signup process for Windows Live based signups.  With OSDP (Office 365) based CRM organizations, the global administrator provisions the CRM Organization and then is required to log into CRM to complete the signup.

I am sure we will improve this error message soon, but hopefully this post helps out any customers who may be currently running into this error message.

Thanks!
Shawn Dieken

Microsoft Premier Field Engineer

The plug-in execution failed because no Sandbox Hosts are currently available.

$
0
0

You have successfully implemented CRM servers and expect your Sandbox service to execute plugins in Isolation mode; however, they fail with an error:

ERROR:
The plug-in execution failed because no Sandbox Hosts are currently available. Please check that you have a Sandbox server configured and that it is running. System.ServiceModel.EndpointNotFoundException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #357E9BEE


Possible Causes:

  • CRM Sandbox service is not running
  • CRM Sandbox ports are unavailable on the sandbox server
  • CRM Sandbox service is missing SPN's
  • CRM Sandbox is remote and the CRM Services cannot be reached


Potential Solutions:

  • Ensure Sandbox services are running on each Full CRM 2011 Server.
    NOTE: Sandbox services are not required to be on a CRM Full serve role, but by using this option the local CRM platform and Async service will use the local sandbox instead of using one over the network.
  • If you are hosting the sandbox service along with one of the IIS dependent server roles , ensure you have TCP port 808 listed within IIS manager bindings for net.tcp.

    Example: 
     
    Ref- For more port information: http://technet.microsoft.com/en-us/library/hh699823.aspx
  • Check if you have the required SPN’s register against the Domain account used to run the Sandbox account. 
    NOTE: It is best practice to have least privileged account run the Sandbox service. 
  • Example: 
    MSCRMsandboxservice/WebServerName 
    MSCRMsandboxservice/WebServerName.Domain.com 
    Ref- CRM 2011 security consideration article: http://technet.microsoft.com/en-us/library/hh699825 
    Ref- Easy generation of SPN’s for CRM 2011 

If the issue is not still not resolved please open a support case with Microsoft for additional support.

Kaustubh Giri

Microsoft Premier Field Engineer

Kerberos in Load Balanced Environments

$
0
0

A very common topic we tend to get many questions on is delegation and troubleshooting delegation usually via one of the many topics that impact this: SPN’s, Kerberos, Load Balancers, 401 errors, etc. Many times detailed environment knowledge is required to make any conclusions, so rather than documenting a complex flowchart that covers every possible scenario, I am going to draft up a fairly common environment and document the various steps required to make sure Kerberos is working for that environment. Kerberos only works properly when everything is setup correctly, so troubleshooting issues can be very frustrating and time consuming. If there is any one issue in the chain, authentication will fail and give you errors like: 
      “Login failed for user: NT AUTHORITY\ANONYMOUS LOGON”
      “Login failed for: NT AUTHORITY\SYSTEM”
      “HTTP Error 401.1 – Unauthorized: Access is denied”
If you’re troubleshooting one of these issues I suggest reading through all the steps in this article and verifying your configuration, then move on to the troubleshooting section.

A few notes regarding this post:

  • These concepts apply to any web applications/services that are referenced by a name other than their computer name in Active Directory (regardless of a physical load balancers presence), in this example I’m using Dynamics CRM as the web application
  • For other Kerberos specific questions I suggest reading the “Kerberos for the busy admin” blog article on the AskDS blog.
  • Kerberos authentication is required if you are persisting a user’s credentials or delegating the user’s credentials through more than 1 hop (this scenario is commonly referred to as “double hop”)
  • For the purpose of demonstration I am illustrating unconstrained delegation. Constrained delegation is an optional way to define which SPN’s allow delegation of credentials (essentially a more specific mapping for delegation).
  • For information on CRM 2011 setup and questions on splitting roles and distributing services for better scaling please refer to my other blog post titled: “Server Setup Frequently Asked Questions” (http://bit.ly/CRMSetupFAQ).
    • In addition the FAQ article includes information about the MSCRMSandboxService SPN which may be required depending on your configuration.

This post has the following assumptions:

  • CRM 2011 is installed on your CRM servers: NDCRMSrv1, NDCRMSrv2, NDCRMSrv3
  • CRM 2011 is installed to databases located on the SQL Server: NDSQLSrv1 (this is for the purpose of demonstration only, CRM does support using multiple SQL servers to host the various CRM databases)
  • SSRS 2008 (or R2) is installed on your reporting servers: NDRPTSrv1 and NDRPTSrv2 and these servers are configured in a Scale-Out deployment (using the same SSRS configuration databases) instructions are here:  http://bit.ly/UhjK2a
  • You have access (or have a process) to request changes or make changes to Active Directory
  • You have not set any SPN’s for these services in your environment and you have no duplicate SPN’s for these services or host machines.
  • Your domain functional level is 2003 or greater
  • You are using Active Directory integrated authentication for Dynamics CRM.

KerberosGraphic_thumb1

  

1) Service Principal Names (SPN’s):

First thing we want to focus on is setting our SPN’s correctly. A service principal Name (SPN) is a way to map identities in Active Directory to various services (SQL, HTTP, etc) hosted in your domain. This mapping is an essential part of issuing and decrypting Kerberos tickets within your environment. Below, in the troubleshooting section, you can see how a workstation will ask your DC’s for a Kerberos ticket via the service name which, for HTTP services, is determined by the URL of the service.

If you run into any scenarios where you believe there must be duplicate SPN’s you’re most likely trying to use more than one identity to host a single service. For example: you’ll notice in the above graphic that we’re hosting the CRM services under the hostname crm.contoso.com and with a single identity: contoso\CRMWeb. If you wanted to add a second website which would use a different port and a different identity, but would use the same URL, you have two options: 1) use a different hostname/URL to differentiate the services 2) register the SPN’s using a port number to differentiate them.

To configure the SPN’s I recommend mapping out all the various services you’re hosting. For HTTP services you’ll also want to map out the URL’s used to access the service*, for this example we have the following potential URL’s:

Potential CRM Service URL’s: Potential Report Service URL’s:
- http://crm
- http://crm.contoso.com
- http://ndcrmsrv1
- http://ndcrmsrv1.contoso.com
- http://ndcrmsrv2
- http://ndcrmsrv2.contoso.com
- http://ndcrmsrv3
- http://ndcrmsrv3.contoso.com
- http://reports
- http://reports.contoso.com
- http://ndrptsrv1
- http://ndrptsrv1.contoso.com
- http://ndrptsrv2
- http://ndrptsrv2.contoso.com

*NOTE: there has been some debate on the need for registering both the Fully Qualified Domain Name (FQDN) SPN as well as the netbios name SPN, generally speaking, I’ll register both just to make sure all bases are covered. In addition, if users will only be using the “friendly” url or alias (in this instance: http://CRM) then registering the SPN’s for each server is not required – but if you plan on using the server names to access the web services (even if it’s for testing) it’s a good idea to register those as well.

Next, you’ll want to construct a table of the various services that will require an SPN. Please note: if you had more than one SQL server or any custom web applications or web services that use different URL’s those should also be added to this table.

Identity/User Hosting the ServiceService Type

Service Principal Name(s)

CRMWeb@contoso.comHTTP

http/crm
http/crm.contoso.com
http/ndcrmsrv1
http/ndcrmsrv1.contoso.com
http/ndcrmsrv2
http/ndcrmsrv2.contoso.com
http/ndcrmsrv3
http/ndcrmsrv3.contoso.com

reportService@contoso.comHTTP

http/reports
http/reports.contoso.com
http/ndrptsrv1
http/ndrptsrv1.contoso.com
http/ndrptsrv2
http/ndrptsrv2.contoso.com

SQLService@contoso.comMSSQLSvcMSSQLSvc/NDSQLSrv1.contoso.com

*NOTE: HTTP is used to identify an SPN as an “HTTP” service, this holds true for both SSL and non-SSL HTTP services. If you are registering any SPN for a web service (SSL or not) the SPN will begin with HTTP. 

2) Registering the SPN’s:

Now that we have a full list of all the SPN’s we’re going to set them up in Active Directory. The easiest way to set an SPN is to use the SetSpn utility in Windows. You will have to have elevated permissions to add SPN’s in Active Directory. The syntax to use for adding the above SPN’s is as follows: SetSpn –S {spnToAdd} {AD Object}. An example of adding the crm.contoso.com SPN and the SQL SPN would be:
  - SetSpn -S HTTP/crm.contoso.com contoso\crmweb
  - SetSpn -S MSSQLSvc/NDSQLSrv1.contoso.com contoso\sqlservice

Repeat this process for each SPN, I’ve found it helpful to have an Excel spreadsheet of my SPN’s and account names and check them off as I add them. You’ll notice that I’ve documented using –S instead of –A, –S is a new option that is used to check for duplicates before adding the SPN – if there are duplicates you’ll receive an error and the SPN will not be added. 

3) Configuring CRM’s IIS Server for Kernel Mode Authentication:

IIS 7 and 7.5 can take advantage of Kernel Mode authentication and CRM configures it’s website to use it. Kernel Mode auth is desired as it improves authentication performance and prevents authentication problems with application pools using custom identities. However, when using a host name that does not match the server name(s) we need to tell IIS to use the Application Pool’s identity (as it’s common on all your servers) and not the system identity this allows the Kerberos tickets to be decrypted by any server behind the load balancer. To do this we’re going to set the UseAppPoolCredentials property in the IIS configuration.

Check the value of the webservers WindowsAuthentication configuration
%systemroot%\System32\inetsrv\appcmd.exe list config -section:system.webServer/security/authentication/windowsAuthentication
image_thumb[132]

Set “UseAppPoolCredentials” in the webservers configuration file:
%systemroot%\system32\inetsrv\appcmd.exe set config -section:system.webServer/security/authentication/windowsAuthentication -useAppPoolCredentials:true /commit:apphost
image_thumb[133]

3.1)Kerberos Auth Persistence (optional)

Configuring persistence of Kerberos credentials will reduce the challenge/responses on the same TCP session resulting in fewer 401’s and better performance. If you analyze a Fiddler trace of communication between the user and the server you’ll notice that most successful responses from a webserver are proceeded by at least one 401, even when the requests are for the same TCP session between the client and server. By setting the AuthPersistNonNTLM property to “true” the webserver will persist the credentials of the user over the existing TCP sessions – dramatically reducing the number of 401’s for the user. If you’re looking in Fiddler you will also notice a Persist-Auth header in the response indicating auth was persisted for that request. If you’re interested in another tweak for better performance through compression of WCF traffic be sure to check out this blog posting: “Enable WCF Compression to Improve CRM 2011 Network Performance

Check the value of the webservers WindowsAuthentication configuration
%systemroot%\System32\inetsrv\appcmd.exe list config -section:system.webServer/security/authentication/windowsAuthentication
image_thumb[134]

Set “authPersistNonNTLM” in the webservers configuration file:
%systemroot%\system32\inetsrv\appcmd.exe set config -section:system.webServer/security/authentication/windowsAuthentication -authPersistNonNTLM:true /commit:apphost
image_thumb[135]

4)Configure your accounts to allow for Kerberos Delegation:

To make sure delegation will succeed in any given environment there are a couple of settings that must be in place before delegation is allowed.

  1. Any services that persist credentials must be allowed to delegate in Active Directory. For this example, we must enable the CRMWeb account to delegate. To do this
    • login to a server with credentials allowing you to edit the given service account
    • Open Active Directory Users & Computers (from the run box type: DSA.msc and press Ok)
    • Click on the root of your domain (in this case it would be Contoso.com)
    • Click on the Find button in the toolbar of Active Directory Users & Computers: image_thumb[137]
    • Find your service account (CRMWeb) and open that objects properties
    • Click on the Delegation tab (this will only show up once the account has an SPN registered – otherwise it is hidden)
    • Make sure to “Trust this user for delegation to any service (Kerberos only)
      image_thumb[142]
      NOTE: if you wish to implement constrained delegation you would select Specified services only and select which SPN’s to use. I recommend setting up unconstrained delegation first, then constraining it after you’ve verified that it works

5) Troubleshooting:

  • Clock Skew – this is an illusive cause and is so obvious it’s often overlooked.  If any of the servers communicating are more than 5 minutes (Default – the policy name is: Maximum lifetime for user ticket Kerberos Policy), if the servers are out of time sync then you can get the same Kerberos errors documented in this article.  On a side note, this one has burned me several times, make this your first check just in case – maybe you’ll get lucky and this will be your silver bullet :)
  • Client Browser IE Configuration: Double check Internet Explorer for the “Enable windows authentication” option:
    • image_thumb1
  • How you access CRM: Kerberos authentication cannot function without connectivity to a domain controller, thus if you are accessing over the internet Kerberos auth will likely fail unless you’re on a VPN or on your corporate network. If you’re accessing CRM over the internet, CRM has a configuration specifically designed to work over the internet called “Claims Based Authentication with Internet Facing Deployment (IFD)”.
  • Check your SPN’s – Windows Server 2008 now includes SetSPN which can be used to list the SPN’s. No special permission should be required to read these SPN’s. For example: to check the CRMWeb account for SPN’s open a command prompt and type the following: setspn –L contoso\crmweb. This will list all the SPN’s found under the CRMWeb account.
  • Event Logs: Check your servers and client System & Security event logs. The System log can contain errors from KDC or Kerberos which might contain useful information and sometimes you’ll find useful failed audit entries in the Security log (be careful with these as they can be benign as well). If this doesn’t yield any results also check the Global Catalog domain controller System Event logs for KDC errors.
  • Check DNS: For each server (CRM, SQL, reports, etc) run nslookup and make sure you get the correct IP address, in addition make sure the reverse lookup is working as well (ie: nslookup {ip} should return you the correct host name).
  • Active Directory Replication: As mentioned above, the SPN’s are stored in Active Directory. If Active Directory replication is delayed or broken the SPN’s will not replicate and you can get inconsistent results. I suggest first checking with your Active Directory admin and having them check replication status and the NTDS logs. If necessary you can use a tool like LDP.exe to bind to each global catalog and check for the SPN’s, but this can be time consuming.
  • Netmon: Capture a netmon trace from your client
    • Close all of your Internet Explorer browsers
    • Start netmon 3.4 and press the New Capture button. Once the new capture tab appears, press the Start Capture button
    • From the run box on your computer type in your server URL: http://crm.contoso.com (for this example)
    • Once the prompt appears stop the netmon capture
    • Enter the following into the “Display Filter” box: KrbError (see in the graphic below)
    • Then press the “Apply” button in Display Filter box to filter your Frame Summary
    • Within the Frame Summary window click on the Kerberos Errors displayed. The frame summary should show you the DC name or IP that responded to the request as well as the error:

NetmonKerbError_thumb1

    • In the Frame Details expand the KRB_ERROR to view the details of the error, this shows exactly which service name failed along with the realm info and other details. In this scenario you would see a failure for the service HTTP/crm.contoso.com or HTTP/crm depending on how you entered the URL into the browser. This Kerberos error is telling you that it cannot find a suitable Service Principal Name matching the service.
  • Enable Kerberos Event Loggingon the server and on your client, you will likely see an error of: “KDC_ERR_PREAUTH_REQUIRED” or “KDC_ERR_S_PRINCIPAL_UNKNOWN” when you attempt to login. Please keep in mind that enabling Kerberos event logging will show you benign errors as well as valid errors to investigate, so I recommend only doing this to validate other errors or once you’ve exhausted other techniques.
  • User delegation blocked. If you have a user that is constantly prompted but other users are not prompted
      • login to a server with credentials allowing you to edit the given user account in Active Directory
      • Open Active Directory Users & Computers (from the run box type: DSA.msc and press Ok)
      • Click on the root of your domain (in this case it would be Contoso.com)
      • Click on the Find button in the toolbar of Active Directory Users & Computers: image_thumb[143]
      • Find the account and open the properties for that user
      • Click on the “Account” tab and make sure the following checkbox is unchecked
        image_thumb[144]
    1. Check for duplicate SPN’s:
      • Please remember, all SPN’s must be unique, if you register a duplicate SPN then neither will function properly (SPN’s are case insensitive). There are a couple of techniques you can use to check for duplicate SPN’s, I’m going to focus on the use of Windows Server 2008’s version of SetSPN. There are two approaches to checking for duplicates using SetSPN:
        1. Check for any duplicate SPN’s for the entire forest – this is a very handy option but in true enterprise environments this can take some time to run and can consume a lot of memory. To do this you run the following command at a command prompt:
          SetSpn.exe –X
        2. Search for a specific SPN across the domain for duplicates. For example, if I wanted to search my domain for any duplicates of the SPN HTTP/crm.contoso.com I would use the following syntax:
          SetSpn.exe –Q HTTP/crm.contoso.com
    2. Use DelegConfig to test Kerberos Authentication and setup: http://bit.ly/PX2b1X 

    As always I’ll do my best to keep up with comments. If you want to keep in touch with our team you can follow us here (http://blogs.msdn.com/CRMInTheField) as well as on Twitter, if you have a Microsoft Premier support contract and wish to work with a member of our team ask your TAM about the PFE offerings we have for Dynamics CRM, and if you want to connect with us at conferences we can be found speaking and attending Dynamics Convergence. We’ll keep any other events or opportunities to connect up to date here and on Twitter.

    Thanks!

    Sean McNellis

    LINQPad 4 Driver for Dynamics CRM REST/Web API are available on CodePlex

    $
    0
    0

    I am pleased to announce that we released “LINQPad 4 Drive for Dynamics CRM REST and Web API (Preview)” on CodePlex.

    For REST: https://crmlinqpadrest.codeplex.com/
    For Web API (Preview): https://crmlinqpadwebapi.codeplex.com/

    If you are interested in SOAP endpoint driver, please refer to previous blog.
    LINQPad 4 Driver for Dynamics CRM is available on CodePlex

    What’s LINQPad?

    LINQPad (http://www.linqpad.net/) is a great tool which you can write and execute LINQ query against many data sources, like SQL Server, Oracle or Web Services. In addition to LINQ query support, the tool also supports C#/F#/VB expression, statement block or program, to write and execute the code and code snippet.

    What can you do with CRM Driver?

    By using CRM Driver, you are able to run LINQ queries against Microsoft Dynamics CRM REST/Web API endpoints on the fly. Follow the steps below to try it out!

    Install Drivers to LINQPad

    1. Download and install LINQPad if you don’t have it yet from http://www.linqpad.net/.

    2. Go to REST Driver and Web API Driver and click “DOWNLOADS” tab, then download CRMLinqPadDriverREST.lpx and CRMLinqPadDriverWebAPI.lpx file.

    3. Open LINQPad and click “Add connection” link on top left.

    image

    4. Click “View more drivers…” button at the bottom of the page.

    image

    5. Click “Browse” button in the bottom of the page.

    6. Select downloaded lpx file, then click “Open”.

    7. Click OK.

    image

    8. Do the same for another driver.

    Use the REST Driver

    Firstly, I explain how to use REST driver.

    Create Connection

    1. Select “Dynamics CRM REST Linq Pad Driver” in Choose Data Context and click “Next”

    image

    2. If you want to use your own ClientId, then uncheck “Register to Azure AD automatically” I will explain what it is later in this article. Click “Login to CRM”. If you want to run query against On-Premise server, (including IFD), you can leave the option as it is.

    image

    3. Login to your Organization at login screen.

    image

    4. Then it automatically starts doing its work and generates a DataContext from the selected organization. Wait until it’s done.

    5. Click “Exit” button once loading completed. Then LINQPad starts loading the schema, which takes a bit of time. Wait until you see the schema information on the left pane like below screenshot.

    image

    Write LINQ query and Execute

    1. Firstly, select added connection from “Connection” dropdown on the top right.

    image

    2. Enter following query to query window.

    image

    3. Click “Play” button or press F5 key to execute query. You will see the result in result pane.

    4. Click SQL tab in result pane, where you can find OData query for REST endpoint.

    image

    Use the Web API (Preview) Driver

    Next, Web API Driver. Please note that Web API is still preview and you have to use Dynamics CRM Online organization which 2015 Update 1 is applied and the feature is enabled.

    Enable Web API (Preview)

    1. Login to Dynamics CRM Online and navigate to Settings | Administration | System Settings.

    2. Click “Previews” tab and enabled Web API.

    image

    Create Connection

    1. Open LINQPad and click “Add Connections”. Select “Dynamics CRM Web API Linq Pad Driver” in Choose Data Context and click “Next”

    image

    2. If you want to use your own ClientId, then uncheck “Register to Azure AD automatically” I will explain what it is later in this article. Click “Login to CRM”. Login to the organization where you enabled Web API preview.

    3. Then it automatically starts doing its work and generates a DataContext from the selected organization. Wait until it’s done.

    4. Click “Exit” button once loading completed. Then LinqPad starts loading the schema, which takes a bit of time. Wait until you see the schema information on the left pane like below screenshot.

    image

    Write LINQ query and Execute

    1. Firstly, select added connection from “Connection” dropdown on the top right.

    image

    2. Enter following query to query window.

    image

    3. Click “Play” button or press F5 key to execute query. You will see the result in result pane.

    4. Click SQL tab in result pane, where you can find OData query for Web API endpoint.

    image

    Write Statements and Execute

    1. To try functions, select “C# Statements” from Language and write Query like below.

    image

    2. SQL tab gives you OData query, too.

    image

    3. In addition to simple function, you are able to try more complex statements like below. This sample code creates an account, and create an opportunity by referecing the account as its parent.

    // Create Account record.
    DataServiceCollection<account> accounts = new DataServiceCollection<account>(this);
    account myaccount = new account();
    accounts.Add(myaccount);
    // Specify field values
    myaccount.name = “Test Account”;
    // Then call SaveChanges to create it.
    this.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

    // Create Opportunity record.
    DataServiceCollection<opportunity> opportunities = new DataServiceCollection<opportunity>(this);
    opportunity myopportunity = new opportunity();
    opportunities.Add(myopportunity);
    // Specify field values
    myopportunity.name = “Test Opps”;
    // Assign the account
    myopportunity.opportunity_customer_accounts = myaccount;

    this.SaveChanges(SaveChangesOptions.PostOnlySetProperties);

    Console.WriteLine(“Opportunity Created”);

    Azure AD Application Registration

    For authentication, Dynamics CRM Online REST based web service endpoints only support OAuth 2. To use OAuth 2.0, you need to register your application (in this case, LINQPad driver) to Azure AD or AD FS (depending on your deployment), which typically requires you to perform manual work. (See Walkthrough: Register a CRM app with Active Directory for more details). To eliminate this manual work, these drivers have a built-in Azure AD Application Registration feature. If you are interested in how to do this, please see the source code.

    By default, it uses your CRM login credential to register the application. However if the credential does not have enough privilege, you will be prompted to enter another credential. If you do not know about this and other people managing your Azure AD, you can ask them to register your application and get the ClientId. Once you get the ClientId, you can use it when adding the connection. Uncheck “Register to Azure AD” checkbox and enter ClientId manually.

    image

    This tool registers your application as follows. If the same application name already exists, then it reuses existing ClientId.

    image

    If you are using On-Premise Server for REST endpoint, the driver uses Windows Integrated Authentication, so it is skipping application registration part.

    Ken
    Premier Mission Critical/Premier Field Engineer 
    Microsoft Japan


    Dynamics CRM Developers: Build Your Own Mobile Apps for Windows, iOS, and Android Part 5

    $
    0
    0

    In the last article, I said I will explain how to use Web API developer preview. However, I got several questions regarding Xamarin.Forms, so I will introduce how you can build Xamarin.Forms app for Dynamics CRM first in this article.

    I assume you already know what is Xamarin, how to register your application to Azure AD, what is OAuth 2.0, overview of Active Directory Authentication Library (ADAL) etc. Please read previous articles for more detail.

    Part 1 | Part 2 | Part 3 | Part4

    Please note, that Xamarin and ADAL are evolving technologies and released new update often, so the technical details in this article may be incorrect when you read it in the near future. I am using Xamarin 3.11.666 and Visual Studio 2013 Update 4 when I write this article.

    Xamarin.Forms

    Xamarin.Forms is one of Xamarin’s product, which lets you write not only business logic but also UI with XAML like technology once and share across multi-platform. Please refer to following link for more detail.
    http://xamarin.com/forms
    http://developer.xamarin.com/guides/cross-platform/xamarin-forms/

    Prepare a solution

    1. Open Visual Studio, and create new project. and select Mobile Apps | Blank App (Xamarin.Forms Shared).
    The reason I do not use Portable Class Library (PCL) is that ADAL doesn’t support Xamarin.Forms yet, thus need to reference ADAL for each project.

    image

    2. Enter name and click “OK”. I name it CrmXForm.

    3. Windows Phone project is targeted to Windows Phone 8.0 by default. Right Click CrmXForm.WinPhone (Windows Phone 8.0) project and click Properties.
    Select Windows Phone 8.1 from Target. Save the changes.

    image

    4. Right click the project in solution explorer and click “Manage NuGet Packages..” to launch the NuGet Package Explorer. Click Updates in the left pane and update Xamarin.Forms to the latest version.

    5. In the NuGet Package explorer, make sure you select nuget.org on the left for the search source, then Search for: Json.NET and install it.

    image

    6. Next, search “ADAL” and select “Active Directory Authentication Library”. Confirm the version is 2.16 or higher which support Silverlight.
    Click Install and it only shows WinPhone project. Click “OK” to install it.

    image

    image

    7. Then search “HttpClient” and select “Microsoft HTTP Client Libraries”, and click Install. Select CrmXForm.WinPhone project and click “OK”

    image

    image

    8. Next, change release category to “Include Prerelease” and search ADAL. Select “Active Directory Authentication Library”, and confirm the version is version 3.3 or higher which supports Xamarin.iOS, and Xamarin.Android. Click Install and select Droid and iOS projects, then click “OK”

    image

    image

    9. Expand CrmXForm.Droid project and right click and click Add References. Add following references.

    System.Net
    System.Net.Http
    System.Runtime.Serialization

    10. Do the same for CrmXForm.iOS project and add following references.

    System.Net
    System.Net.Http
    System.Runtime.Serialization
    System.Xrm.Linq

    11. Delete unnecessary files from iOS projects. Delete iTunesArtwork files and all files under Resources folder of iOS Project.

    12. Right click CrmXForm.iOS project and click Properties. Change SDK version as desired on iOS Build | General. I selected 8.1 here.

    image

    13. Click iOS Application on the left pane, and select 8.1 for Deployment Target and remove Launch Storyborad. I selected 8.1 here.

    image

    14. Build the solution, and run each project to confirm it works fine at this point.

    Add CRM SDK and Help Files

    Next, add CRM and ADAL related codes.  There are many ways to achieve the same, so please feel free to change code or folder structure if you want to manage them in a different way.

    1. Firstly, add CRMSDK files to the shared project. Right click the CrmXForms Shared project and click Add | New Folder. Name it as CRMSDK.

    2. Open browser and go to https://code.msdn.microsoft.com/Mobile-Development-Helper-3213e2e6. Download the sample and extract it all to a known location.

    image

    3. In the solution explorer right click the the CRMSDK Folder in the Visual Studio solution explorer under the project, select Add, Existing Item, select all the .cs files you extracted above except CRMHelper.cs .

    image

    4. Once completed, double click Microsoft.Xrm.Sdk,Samples.cs to open the cs file.

    5. Comment out line 35, and 666-682. There lines are for Windows Store/Phone application and Xamarin does not understand it.

    6. Next, add CRMSDK wrapper which handles Authentication and error handling when calling SDK methods. Right Click the CrmXForms Shared project and add another folder, and name it as Helper.

    7. Right click the Helper folder and add a class file, name it as OrganizationServiceProxy.cs, which will be wrapper of CRMSDK.

    8. Replace the folder with following code. Use“http://crmxform.local” as redirect Uri for Android and iOS and register the application to Azure AD get obtain ClientId.

    using Microsoft.Crm.Sdk.Messages.Samples;
    using Microsoft.IdentityModel.Clients.ActiveDirectory;
    using Microsoft.Xrm.Sdk.Query.Samples;
    using Microsoft.Xrm.Sdk.Samples;
    using System;
    using System.Threading.Tasks;

    namespace CrmXForm.Helper
    {
        // Inherit from OrganizationDataWebServiceProxy.
        public class OrganizationServiceProxy : OrganizationDataWebServiceProxy
        {
            #region Method     

            public OrganizationServiceProxy()
            {
                ServiceUrl = ServerUri;
            }

            // Wrap SDK methods. This example uses Execute and Retrieve method only.
            public async Task<OrganizationResponse> Execute(OrganizationRequest request)
            {
                // Aquire Token before every call.
                await Authenticate();
                // I omit try/catch error handling to make sample simple.
                return await base.Execute(request);
            }

            public async Task<Entity> Retrieve(string entityName, Guid id, ColumnSet columnSet)
            {
                await Authenticate();
                return await base.Retrieve(entityName, id, columnSet);
            }

            private async Task Authenticate()
            {
                // Make sure AccessToken is valid.
                await GetTokenSilent();

                // Wait until AccessToken assigned
                while (String.IsNullOrEmpty(AccessToken))
                {
                    await System.Threading.Tasks.Task.Delay(10);
                }
            }
           
            #endregion

            #region ADAL

            #region Property

            public AuthenticationContext authContext = null;
           
    #if __ANDROID__
            public Android.App.Activity activity;
    #elif __IOS__
            public UIKit.UIViewController uiViewController;
    #endif

            private string OAuthUrl = “https://login.windows.net/common/oauth2/authorize”;
            private string ServerUri = “https://<org>.crm.dynamics.com”;
           
            // Register the application to get ClientId.
            private string ClientId = “<your ClientId>”;

    #if __ANDROID__ || __IOS__
            private string RedirectUri = “http://crmxform.local”;
    #else
            private string RedirectUri = Windows.Security.Authentication.Web.WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString();
    #endif             

            #endregion

            #region Method

            private async Task GetTokenSilent()
            {
                // If no authContext, then create it.
                if (authContext == null)
                {
    #if __ANDROID__ || __IOS__
                    authContext = new AuthenticationContext(OAuthUrl);
    #else
                    authContext = AuthenticationContext.CreateAsync(OAuthUrl).GetResults();
    #endif
                }

                AuthenticationResult result = null;

    #if __ANDROID__
                IPlatformParameters parameters = new PlatformParameters(activity);
    #elif __IOS__
                IPlatformParameters parameters = new PlatformParameters(uiViewController);
    #endif

    #if __ANDROID__ || __IOS__
                try
                {
                    result = await authContext.AcquireTokenAsync(ServerUri, ClientId, new Uri(RedirectUri), parameters);
                    StoreToken(result);
                }
                catch (Exception ex)
                {               
                }
    #else
                result = await authContext.AcquireTokenSilentAsync(ServerUri, ClientId);
                if (result.Status == AuthenticationStatus.Success)
                    StoreToken(result);
                else
                    authContext.AcquireTokenAndContinue(ServerUri, ClientId, new Uri(RedirectUri), StoreToken);
                return;
    #endif
            }

            /// <summary>
            /// This mothod called when ADAL obtained AccessToken
            /// </summary>
            /// <param name=”result”></param>
            private void StoreToken(AuthenticationResult result)
            {           
                AccessToken = result.AccessToken;
            }

            #endregion

            #endregion
        }
    }

    9. Save the change and add another class file, and name it as CrmXFormHelper.cs. Overwrite the code with following. This is the helper class which application uses.

    using Microsoft.Crm.Sdk.Messages.Samples;
    using Microsoft.Xrm.Sdk.Query.Samples;
    using Microsoft.Xrm.Sdk.Samples;
    using System.Threading.Tasks;
    using Xamarin.Forms;

    namespace CrmXForm.Helper
    {
        static public class CrmXFormHelper
        {
    #if __ANDROID__
            static public Android.App.Activity activity
            {
                set { Proxy.activity = value; }
            }
    #elif __IOS__
            static public UIKit.UIViewController uiViewController
            {
                set { Proxy.uiViewController = value; }
            }
    #endif
            static private OrganizationServiceProxy proxy;
            static public OrganizationServiceProxy Proxy
            {
                get
                {
                    if (proxy == null)
                        proxy = new OrganizationServiceProxy();
                    return proxy;
                }
            }

            static public async Task<string> GetLoginUser()
            {
                WhoAmIResponse result = (WhoAmIResponse)await Proxy.Execute(new WhoAmIRequest());
                Entity user = await Proxy.Retrieve(“systemuser”, result.UserId, new ColumnSet(“fullname”));

                return user[“fullname”].ToString();
            }
        }
    }

    Update Project startup files

    1. Now its time to update each Project startup page to pass information for ADAL to Helper code. Expand CrmXForm.Droid project and open MainActivity,cs. Add below using statement.

    using CrmXForm.Helper;
    using Android.Content;
    using Microsoft.IdentityModel.Clients.ActiveDirectory;

    2. Add following line in OnCreate method.

    CrmXFormHelper.activity = this;

    3. Add following method in MainActivity class which will be called after authentication.

    protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
    {
        base.OnActivityResult(requestCode, resultCode, data);
        // Pass the authentication result to ADAL.
        CrmXFormHelper.Proxy.authContext.SetAuthenticationAgentContinuationEventArgs(requestCode, resultCode, data);
    }

    4. Expand CrmXForm.iOS project and open AppDelegate.cs file. Add below using statement.

    using CrmXForm.Helper;
    using Xamarin.Forms;

    5. Replace inside FinishedLaunching method with following code.

    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {           
        global::Xamarin.Forms.Forms.Init();

        var application = new CrmXForm.App();
        window = new UIWindow(UIScreen.MainScreen.Bounds);
        window.RootViewController = application.MainPage.CreateViewController();
        window.MakeKeyAndVisible();
               
        CrmXFormHelper.uiViewController = window.RootViewController;

        LoadApplication(application);
        return true;
    }

    6. Add following code in AppDelegate class.

    UIWindow window;

    7. Expand CrmXForm.WinPhone and expand App.xaml, then open App.xaml.cs file. Add below using statements.

    using Windows.ApplicationModel.Activation;
    using CrmXForm.Helper;

    8. Add following method in App class which will be called after Authentication.

    private async void Application_ContractActivated(object sender, Windows.ApplicationModel.Activation.IActivatedEventArgs e)
    {
        var webAuthenticationBrokerContinuationEventArgs = e as WebAuthenticationBrokerContinuationEventArgs;
        if (webAuthenticationBrokerContinuationEventArgs != null)
        {
            await CrmXFormHelper.Proxy.authContext.ContinueAcquireTokenAsync(webAuthenticationBrokerContinuationEventArgs);
        }
    }

    9. Add following code in InitializePhoneApplication method, which relates above code to ContractActivated event.

    PhoneApplicationService.Current.ContractActivated += Application_ContractActivated;

    10. Double click Package.appxmanifest file and click Capabilities tab. Check Internet (Client & Server).

    image

    Add MainPage

    Finally, lets add a page to the project. As Xamarin.Forms support data binding natively, I am using MVVM model. I am including INotificationPropertyChanged and Relay command in the same file to simply the code, but I recommend to separate those into single files in real application.

    1. Right click the CrmXForms Shared project and click Add | New Folder. Name it as View. Add ViewModel folder too.

    2. Right click ViewModel folder and add a class file, name it as “MainPageViewModel.cs. Replace code with following. This ViewModel will be used by MainPage.xaml which you will add next.

    using CrmXForm.Helper;
    using System;
    using System.ComponentModel;
    using System.Windows.Input;

    namespace CrmXForm.ViewModel
    {
        public class MainPageViewModel : INotifyPropertyChanged
        {
            private string userName;
            public string UserName
            {
                get { return userName; }
                set
                {
                    userName = value;
                    NotifyPropertyChanged();
                }
            }

            public RelayCommand GetUserName
            {
                get
                {
                    return new RelayCommand(async () =>
                    {
                        UserName = await CrmXFormHelper.GetLoginUser();
                    });
                }
            }

            #region INotifyPropertyChanged Members

            public event PropertyChangedEventHandler PropertyChanged;

            // Used to notify Silverlight that a property has changed.
            internal void NotifyPropertyChanged([System.Runtime.CompilerServices.CallerMemberNameAttribute] string propertyName = “”)
            {
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
                }
            }

            #endregion

            #region RelayCommand

            public class RelayCommand : ICommand
            {
                private readonly Action _execute;
                private readonly Func<bool> _canExecute;

                public event EventHandler CanExecuteChanged;

                public RelayCommand(Action execute)
                    : this(execute, null)
                {
                }

                public RelayCommand(Action execute, Func<bool> canExecute)
                {
                    if (execute == null)
                        throw new ArgumentNullException(“execute”);
                    _execute = execute;
                    _canExecute = canExecute;
                }

                public bool CanExecute(object parameter)
                {
                    return _canExecute == null ? true : _canExecute();
                }

                public void Execute(object parameter)
                {
                    _execute();
                }

                public void RaiseCanExecuteChanged()
                {
                    var handler = CanExecuteChanged;
                    if (handler != null)
                    {
                        handler(this, EventArgs.Empty);
                    }
                }
            }

            #endregion       
        }
    }

    3. Right click View folder and add “Form Xaml Page”. Name it as MainPage, which will add MainPage.xaml and MainPage.xaml.cs files.

    image

    4. Open MainPage.xaml file and replace Label to Grid like below.

    image

    5. Open MainPage.xaml.cs. Replace the code with following.

    using CrmXForm.ViewModel;
    using Xamarin.Forms;

    namespace CrmXForm.View
    {
        public partial class MainPage : ContentPage
        {
            MainPageViewModel vm = new MainPageViewModel();
            public MainPage ()
            {
                InitializeComponent ();
                this.BindingContext = vm;
            }
        }
    }

    6. Now set the added page to initial page. Open App.cs. Replace the constructor code as following.

    public App ()
    {
        // The root page of your application
        MainPage = new MainPage();
    }

    7. Compile the solution.

    Compile the solution.

    Run the application

    Let’s try Windows Phone first.

    1. Right click CrmXForm.WinPhone project and click “Set as Startup Project”.

    2. Select target and presss F5. I selected “Emulator 8.1 WVGA 4 inch 512MB”.

    3. When the application launched, click the button.

    image

    4. When you prompted, enter user credential and click “Sign In”.

    image

    5. After you signed in wait for a while and the application displays login user’s fullname.

    image

    6. Let’s try iOS next. Right click CrmXForm.iOS project and click “Set as Startup Project”. Select target and press F5. I selected “iPhone 6 iOS 8.1” simulator.

    image

    7. When the application runs, you will see the button below. Click it.

    image

    8. You will be prompted. Enter user credential and click “Sign in”.

    image

    9.Fullname of login user will be displayed.

    image

    10. Do the same for Android, too.

    Xamarin.Forms PCL and WinRT application?

    The reason I used Xamarin.Forms shared project is because ADAL does not support it yet as I explained. In the future, ADAL may support Xamarin.Forms PCL, and it also supports WinRT application in addition to Silverlight. So what is the best choice? It is up to you, as there are several pros and cons to use Shared vs. PCL, and I do not have any recommendation myself.

    What’s Next?

    As I promised in previous article, I will show you how to use Web API developer preview.

    Ken
    Premier Mission Critical/Premier Field Engineer 
    Microsoft Japan

    Manage Dynamics CRM data and settings with PowerShell!

    $
    0
    0

    Hey everyone, I have a new exciting project to share with the community. Kenichiro  and I recently released a scripted PowerShell module (PSM1) called Microsoft.Xrm.Data.Poweshell.  This PowerShell module enables admins to query and manipulate Dynamics CRM Data. It supports On-Prem and Online and primarily targets releases CRM 2013 and greater, however I have been able to connect to CRM 2011 for basic operations.

    So, what can you do with this PowerShell module?

    • Query, Create, Update, and Delete CRM records
    • Execute workflows, change business units, assign/remove roles
    • Review plugin traces (in CRM version 7.1+ and higher) and Mailbox Trace data
    • Review customization solution import results (including the result XML)
    • Import, export, and publish customizations
    • much more!

    You can download the module by following the link, but I’ve also included installation instructions at the bottom of the post: Xrm.Data.Poweshell: PowerShell for Dynamics CRM Organization Data or you can use the short URL of: http://aka.ms/CRMPowerShell

    Why?

    Reason #1: customers, our customers have been asking for this and Ken and I wanted to make management and querying CRM data easier and accessible to everyone. While the XrmTooling Powershell snapin provides a connection and proxy back to CRM, the proxy is a bit difficult to work with and admins usually just want to get work done. To enable this, Ken and I targeted the most common operations admins and developers would want based on feedback we’ve heard in the field with customers. Additionally, we’ve packaged the tooling DLL with our module meaning you don’t have to register the snapin to connect to CRM when using this module.

    Also, with CRM onprem and online, admins need a standardized way to query data and configure their instances of CRM (no matter where they’re hosted). This module will allow you to import it and get right to work, query data, query metadata, get entity attributes, verify record data that isn’t easily viewable in CRM and more. We did our best to follow the common patterns for naming like: ‘get-crmRecords’, ‘connect-CrmOnlineDiscovery’. 

    Who should use this?

    The target audience for the module is for IT Admins, CRM Admins, and developers – it’s very helpful to verify attribute metadata, get record counts, look at entity metadata, etc. The module provides basic and common functions to allow easy downloading and usage of the module. We also released several samples to illustrate common uses.

    What’s next?

    • We’re looking at listing this in a repository like Chocolatey (https://chocolatey.org/) so you can install it via OneGet  – this is a work in progress and something we haven’t attempted yet – if you have any tips please share! Smile 
    • I hope to try and get a screencast recorded showing some simple uses of the module to help with getting started quickly
    • We will keep adding more functions to the module, at the same time we’ll add more sample scripts so that you can simply modify them and and use them immediately. Any feedback is welcome, so please post Questions in the Q&A section here: https://gallery.technet.microsoft.com/scriptcenter/PowerShell-functions-for-16c5be31/view/Discussions#content 
    • AzureAutomation – currently it appears XrmTooling has some dependencies that we believe are not compatible with Azure Automation (at least not without some tweaking).  Ken and I looking into this, we’ll do what we can to make the current version work or try and get something out to work in Azure Automation if at all possible.

    We look forward to your feedback and as always, thanks for reading! 

    Sean McNellis & Kenichiro Nakamura


    @seanmcne
    @pfedynamics | http://www.pfedynamics.com

    ——————————————————————————————–

    PowerShell Module Installation Instructions:

    1. You can download the module here installation instructions are below: Microsoft.Xrm.Data.Poweshell: PowerShell for Dynamics CRM Organization Data

    2. Download the zip file and save it to disk

    3. Right-click the Zip file and press properties 

    4. On the properties page: Check "Unblock" checkbox and click "OK", or simply click "Unblock" the button could look differently depending on the OS.

    5. Extract the zip file and copy "Microsoft.Xrm.Data.PowerShell" folder to one of the following folders:
       • %USERPROFILE%\Documents\WindowsPowerShell\Modules
       • %WINDIR%\System32\WindowsPowerShell\v1.0\Modules 

    The image below shows this module copied to User Profile. If you want all users to have the module accessible on the computer, copy them to System Wide PowerShell module folder instead. If you do not have the folder, you can manually create them.

    6. The module is not signed and you may need to change Execution Policy to load the module. You can do so by executing following command (Please refer to Set-ExecutionPolicy for more information).

    Set-ExecutionPolicy –ExecutionPolicy RemoteSigned –Scope CurrentUser

     

    7. Open PowerShell and run following command to load the module.

    Import-Module Microsoft.Xrm.Data.Powershell

    8. Here is a sample on how to query all accounts from a CRM Online org called “Contoso”

    Import-Module Microsoft.Xrm.Data.Powershell -verbose –force
    $me = Get-Credential
    $myOrg = Get-CrmConnection -Credential $me -DeploymentRegion NorthAmerica –OnlineType Office365 –OrganizationName CONTOSO -verbose
    Get-CrmRecords -conn $myOrg -EntityLogicalName systemuser -Fields *

    #now retrieve all users who have a fullname like ‘Sean%’
    Get-CrmRecords -conn $myOrg -EntityLogicalName systemuser -Fields * -FieldName fullname -FilterOperator like -FilterValue ‘Adventure%’

    Performance Tuning with Email Tagging

    $
    0
    0

    One of our customers is adding many new users to Dynamics CRM system almost every month. As the number of CRM users increased, they are starting to see more alerts from their load balancer F5 indicates that IIS is not responding.  After some investigation, it appears the issues are related to requests that have been queued in IIS and are waiting on responses from SQL.  Based on our prior recommendation, they used DynamicsPerf to identify their performance bottleneck.

    Finding Performance Bottleneck

    Performance Analyzer for Microsoft Dynamics is a toolset developed by Premier Field Engineering at Microsoft. The toolset is designed to collect SQL Server Data Management Views (DMVs) and Microsoft Dynamics data into a singular database called DynamicsPerf. This tool helps customers to identify performance issues on Microsoft Dynamics products (CRM, AX, GP, NAV, SL).

    Using DynamicsPerf, they found their most expensive query is related to email tagging:

     

    select

    DISTINCT  top 51 “email0″.ModifiedOn as “modifiedon”, “email0″.MessageId as “messageid”, “email0″.ActivityId as “activityid”,

    “email0″.RegardingObjectId as “regardingobjectid”, “email0″.Subject as “subject”, “email0″.RegardingObjectIdYomiName as “regardingobjectidyominame”,

    “email0″.RegardingObjectIdName as “regardingobjectidname”, “email0″.RegardingObjectTypeCode as “regardingobjecttypecode”

    from

    Email as “email0″ join ActivityParty as “activityparty1″ on (“email0″.ActivityId  =  “activityparty1″.ActivityId and ((“activityparty1″.PartyId = @PartyId0)))

    where

    (( “email0″.ModifiedOn >= @ModifiedOn0  and “email0″.MessageId is not null))

    order by

    “email0″.MessageId asc, “email0″.ActivityId asc

     

    Fig 1. Performance statistics

     

    With performance bottleneck identified, what should you do next?

    Enable or Disable Email Tagging

    In CRM 2011 and 2013, email tagging is enabled by default. However, some customers may not need email tagged to be turned on. It is important to review your environment and see if you really need to have email tagging enabled. There are two scenarios that enabling email tagging is useful. If they don’t apply to your environment, then consider to turn off email tagging to improve performance.

    So what are the two scenarios? Our colleague, Aaron Richards, provided great information in his article–CRM E-mail Tracking: Part 3- Tagging Deep Dive:

    1. When the user record (Settings| Administration| Users) is set to use the Email Router. When using the Email Router for incoming and outgoing emails, the CRM for Outlook client cannot tell whether or not the emails should be tracked, as they are routed through the Email Router for tracking instead. Since the tagging process’s main goal is to retrieve changes to emails from the CRM Server and bring them to the CRM for Outlook client, tagging will see that these emails have been added to or changed in CRM and that they should be tracked when requesting records from the CRM Server and it will then pull down these change to the CRM for Outlook client to show these emails as tracked.

    2. The second scenario is where the System Settings (Settings| Administration | System Settings) “Track e-mails sent between CRM users as two activities” is not marked. If two CRM users are included on an email, each user has the option to track this into CRM. Now, if User1 tracks this to a specific record (Record A), the Set Regarding record will then be updated on the CRM Server for that email. However, if User2 tracks this email from their CRM for Outlook client and sets the regarding to a different record in CRM (Record B), this will update the Set Regarding for the same email record on the CRM Server. If tagging is enabled on User1’s CRM for Outlook client, this set regarding change will roll down to User1’s email in their CRM for Outlook client and they will now see this Set Regarding to Record B.

    For the first scenario, it mentioned Email Router for Incoming and Outgoing emails. If you are using server side sync for emails, your tracked emails should show as tracked with email tagging off. So if a user sends an email from within CRM it would show as tracked even if you turned off email tagging.

    After reviewed Aaron Richards’ article and their environment, our customer decided that they are safe to disable email tagging. So they are planning to start to implement this with a small group of users, then roll out to all CRM users.

    Client Side Change

    Our customer wondered how to make this change for their users. Email tagging setting is determined by client side registry keys. It is not a server side setting. So they will need to roll this out to their CRM users via Group Policy. This applied to CRM 2011 and 2013. Again, you can find more detailed information from Aaron Richards’ article–CRM E-mail Tracking: Part 3- Tagging Deep Dive.

    Some customers are asking why not make email tagged disabled by default? That is being considered as an enhancement for future release.

    Helpful Resources

    CRM E-mail Tracking: Part 3- Tagging Deep Dive

    Slow performance when you use the Microsoft Dynamics CRM 2011 client for Outlook

    Dynamics CRM Outlook Client Performance Troubleshooting and Optimizations Guide

    Hope this article is helpful. Thanks everyone!

    Andy


    Podcast and Overview: Microsoft Dynamics CRM 2015 Update 1.1

    $
    0
    0

    Contents:

    We’re proud to announce that all packages for Microsoft Dynamics CRM 2015 Update 1.1 (Update Rollup 1) were released September 10th, 2015 to the Microsoft Download Center!  These packages appeared on Microsoft Update October 7th, 2015.

    Why a blog regarding a “CRM Online Update”?

    As you probably know, Microsoft Dynamics CRM 2015 Update 1.1 is generally considered to be the Online-only server changes code-named Carina.  However, there are 3 sets of packages (32- and 64-bit) on the Microsoft Download Center and Microsoft Update that are also compatible with CRM 2015 On-Premise, and contain changes not in already released Microsoft Dynamics CRM 2015 Update 0.1:

    • CRM 2015 Client for Microsoft Office Outlook
    • CRM 2015 MUI (Multi-Language User Interface
    • CRM 2015 Email router

    Note the naming convention change!  Post-RTM Updates used to be called Update Rollups, now they’re just called Updates with the version number:

    Was: Microsoft Dynamics CRM Update Rollup 1 or 2

    Is now: Microsoft Dynamics CRM Update 0.1 or 0.2

    For more details, see the Dynamics CRM Product Group blog “New naming conventions for Microsoft Dynamics CRM updates

    Microsoft Dynamics CRM 2015 Update 1.1 Build number:

     7.1.1.3113

    Microsoft Dynamics CRM 2015 Update 1.1 Microsoft Download Center page

    Here’s the “Master” Microsoft Dynamics Knowledge Base article for Microsoft Dynamics CRM 2015 Update 1.1: (KB 3072333). Going forward, the plan is to continue publishing Master Knowledge Base articles for CRM Updates a bit in advance of release to aid planning.

    Podcast

    On October 28th, 2015, Greg Nichols, Ryan Anderson, and Rohan Katpelly from the Microsoft CRM Premier Field Engineering Team provided information about:

    • The release of Microsoft Dynamics CRM 2015 Update 1.1
    • New fixes made available in Microsoft Dynamics CRM 2015 Update 1.1

    during their Microsoft Dynamics CRM 2015 Update 1.1 Podcast

    Note regarding Podcasts: We’ve recently changed the location of where we are hosting and distributing our podcasts.  See PFE Dynamics Podcast Update for more information.

    Go to Top

    The “CRM Update Rollup Collateral Page

    For pointers to download locations, release dates, build information, and CRM Premier Field Engineering blogs and podcasts for all supported Microsoft Dynamics CRM Update Rollups and Service Packs, visit the “CRM Update Rollup and Service Pack Collateral Page

    Go to Top

    Important note:

    An updated Unified Service Desk (Build 06.01.0001.0132) for CRM 2013 Service Pack 1 and CRM 2015 has been released as part of Update Rollup 1 for Microsoft Dynamics CRM 2013 SP1. See the following Microsoft Download Center webpage for download details:

    Unified Service Desk for Microsoft Dynamics CRM 2013 / 2015

    General Upgrade Rollup and Service Pack Notes:

    • Testing CRM Update Rollups: Best Practices
      • Microsoft Dynamics CRM Premier Field Engineering recommends doing all the standard testing you generally do for all Updates, which could be the functional and performance testing that you would do with a new major release or a subset of that test plan
      • The “general rule of thumb” for test plans for Update Rollup installs are:
        • Test any changes in a pre-production environment BEFORE introducing into your production environment. Manage your risk!
        • Consider using the Performance Toolkit for Microsoft Dynamics CRM 2013 and 2015 to simulate your production user load in your testing environment to shake out any performance-related issues early. The link point to a recently-released version of the Toolkit reworked to support CRM 2013 and CRM 2015!  Talk to your TAM (Technical Account Manager) if you want Premier Field Engineering to help your team install and configure it!
        • Test using the permissions your most restrictive end-user roles have. Testing with CRM Administrator permissions, for example, does not give you the complete picture
        • Concentrate on your SDK customizations, JavaScript, ISV add-ons – basically anything that’s not OOB functionality or customizations done from within the UI

    Go to Top

    Microsoft Dynamics CRM 2015 Update 1.1 packages are available for download via: 

    • The Microsoft Dynamics CRM 2015 Update 1.1 Microsoft Download Center page – released September 10th, 2015
    • The Microsoft Update Catalog – released October 7th, 2015
    • The Microsoft Update detection / installation process
      • Note: Microsoft Dynamics CRM 2015 Updates will be pushed via Microsoft Update as Important updates
      • Client packages installed manually by downloading the packages and running install will require local administrator privileges. If the client packages are installed via Microsoft Update or SCCM (System Center Configuration Manager), they will not require local administrator privileges
      • Consider using Windows Server Update Services (WSUS) or similar software distribution technologies to distribute Dynamics CRM Update Rollups internally.  WSUS is a locally managed system that works with the public Microsoft Update website to give system administrators more control. By using Windows Server Update Services, administrators can manage the distribution of Microsoft hotfixes and updates released through Automatic Updates to computers in a corporate environment
      • For help with installation please see the Installation Information section of the Microsoft Dynamics CRM 2015 Update 1.1 “master” Microsoft Knowledge Base article
      • Please review Jon Strand’s blog posting “CRM 2011: Silently Installing Update Rollups” which provides details on installing CRM Outlook client update rollups “silently” in order to limit end-user interruption, which also applies to CRM 2013 and CRM 2015 Updates, Update Rollups, and Service Packs for these CRM components:

    Microsoft Dynamics CRM Server 2015

    Microsoft Dynamics CRM 2015 for Microsoft Office Outlook (Outlook Client)

    Unified Service Desk for Microsoft Dynamics CRM 2015

    Provides a configuration-based framework for quickly building agent applications for call centers. You can aggregate customer information from different areas in Microsoft Dynamics CRM into a single desktop and get a 360° view of customer interactions

    Microsoft Dynamics CRM 2015 Email Router

    Microsoft Dynamics CRM 2015 SSRS (SQL Server Reporting Services) Data Connector The SSRS Data Connector is not available as an individual download.  It is included in the Microsoft Dynamics CRM Server 2015 download. When you extract the Server package (CRM2015-Server-ENU-amd64.exe /extract:path: extracts the content of the package to the path folder), you’ll find the Data Connector in the SrsDataConnector folder

    Microsoft Dynamics CRM 2015 Language Packs

    Microsoft Dynamics CRM 2015 for Windows 8 (“MoCA” – the Mobile Client Application available via the Windows Store)

    Microsoft Dynamics CRM for iPad (in iTunes)

    Microsoft Dynamics CRM 2015 Report Authoring Extension (with SQL Server Data Tools support)

    Microsoft Dynamics CRM 2015 List Component Microsoft Dynamics CRM 2015 List Component for Microsoft SharePoint Server 2010 and Microsoft SharePoint Server 2013 (for multiple browsers)

    Go to Top

    Microsoft Dynamics CRM 2015 Update 1.1 Prerequisites:

    • Essentially the prerequisites listed in the Microsoft Dynamics CRM 2015 Implementation Guide download or specific TechNet content for the various CRM components serviced

    Go to Top

    Issues resolved via Microsoft Dynamics CRM 2015 Update 1.1: 

    Microsoft Dynamics CRM 2015 Update 1.1 contains fixes for issues reported by customers or discovered via internal testing.

    Fixes released via Microsoft Dynamics CRM 2015 Update 1.1:

    • Daylight Savings Time changes for Egypt
    • Integrated Authentication in a Federated environment fails using the CRM for Outlook client
    • Exporting more than 5000 records results in duplication of records
    • Workflow conditon step evaluation will throw an exception when user’s CultureInfo is null
    • USD client error when HKLM write permission is denied although key already exists
    • Multiple Workflow processes are created when an update occurs even when no additional changes are made on the invoice form
    • Running a Workflow on an update step clears the email Body\Description field
    • PublishAll times out as it tries to read all Workflow processes in a draft state
    • Async jobs from one organization may hang due to jobs in another organization
    • When creating new Alternate Keys, it lists owneridtype as an attribute. Trying to create a key with this attribute results in an error
    • When updating large amounts of rollup fields, this will create many entries in the RollupJobBase table and is unable to keep up with processing these jobs, causing them to hang
    • Solution Import fails due to conflict with MailboxTrackingFolders
    • Cannot configure Document Management with SharePoint 2010 and Windows Server 2012.
    • “An error occurred when CRM tried to generate the Excel file” when attempting to Export to Excel
    • When using SharePoint and CRM Integration with the List Component and after creating the Documents folder, the Grid is not visible when navigating back and forth
    • After Upgrading to CRM 2015 Post 7.1, Navigation Bar Items that used to display a scroll bar when they overflow to the right, no longer able to scroll.
    • Subgrids placed in a Quick View form does not work correctly
    • Errors occur when launching Outlook when items are tracked and exist in a non-default Outlook store.
    • After choosing to remain offline in the Outlook Client, the Outlook Client continues to attempt to go online every fifteen minutes.
    • CRM for Outlook client stops working after change of Network password if credentials are cached
    • When an email contains an unresolved party member in the CC line, users will be unable to click the Reply All button.
    • Invalid Argument error on Data Import when Format language code and user interface language code do not match
    • When importing a Solution containing an action the customer gets the following error message:sdkmessage With Id = [GUID] Does Not Exist
    • Navigation Bar does not load when a parameter is added to the querystring of main.aspx

    Known issues that occur by using the Microsoft Edge Browser (with Windows 10) after you install Update 1.1 for Microsoft Dynamics CRM 2015:

    • When a lInk opens in a new Dialog, it is not in focus
    • SSRS Reports will not render properly
    • Multi-line tests appears overlapped
    • Copy and Paste via mouse will not work on certain fields
    • Custom Option value is available on the Selection criteria Field
    • Font does not show up properly using the Japanese language

    Go to Top

    Support for new technologies provided by CRM 2015 Update 1.1:

    The Microsoft Dynamics CRM Engineering team consistently tests Microsoft Dynamics CRM and associated CRM Updates against pre-release and release versions of technology stack components that Microsoft Dynamics interoperates with. When appropriate, Microsoft releases enhancements via future Microsoft Dynamics CRM Updates or new major version releases to assure compatibility with future releases of these products. This compatibility matrix is updated via this Microsoft Knowledge Base article: Microsoft Dynamics CRM Compatibility List.

    Microsoft Dynamics CRM 2015 Update 1.1 provides support for:

    Hotfixes and updates that you have to enable or configure manually

    Occasionally, updates released via Microsoft Dynamics CRM Updates require manual configuration to enable them. Microsoft Dynamics CRM Updates are always cumulative; for example, Update 0.2 will contain all fixes previously released via Update 0.1 as well as fixes newly released via Update 0.2. So if you install Update 0.2 on a machine upon which you previously installed no Updates, you will need to manually enable any desired fixes for Update Rollups 0.1 – 0.2:

    • Microsoft Dynamics CRM 2015 Update 0.1: no updates requiring manual configuration
    • Microsoft Dynamics CRM 2015 Update 1.1: no updates requiring manual configuration

    Go to Top

    Microsoft Dynamics CRM compatibility with technology stack components: Internet Explorer, Windows Client and Server, Office, .NET Framework, and more

    The Microsoft Dynamics CRM Engineering team consistently tests Microsoft Dynamics CRM 2015 Update Rollups against pre-release and release versions of technology stack components that Microsoft Dynamics interoperates with. When appropriate, Microsoft will release enhancements via future Microsoft Dynamics CRM Update Rollups, Service Packs, or new major version releases to assure compatibility with future releases of these products. This compatibility matrix is updated via this Microsoft Knowledge Base article: Microsoft Dynamics CRM Compatibility List.

    Greg Nichols Dynamics CRM Senior Premier Field Engineer Microsoft Corporation

    CRM2015u11.mp3

    Great Power Tools for CRM Administrator: Microsoft.Xrm.Data.PowerShell module – Part I

    $
    0
    0

    Want to change CRM settings for 3,000 users? Or get CRM organization data without having to call a programmer? With Microsoft.Xrm.Data.PowerShell CRM PowerShell module recently published on TechNet, a CRM administrator can become highly productive. This module allow you to perform CRUD operations with Dynamics CRM data and change user and system Settings for both Dynamics CRM Online and On-Premise environments. Here is the good news—these CRM operations are using PowerShell, a skillset you already have for other administrative tasks. 

    The download package also comes with sample scripts to illustrate how to:

    • Operate against multiple CRM organizations
    • Update multiple CRM user settings
    • Provisioning Language Pack
    • Add Azure Active Directory users and CRM Online users from CSV file
    • Add Active Directory users and CRM On-Premise users from CSV file
    • Add CRM On-Premise users from users under specific Active Directory OU

    This blog article will guide you through the process of how to download and start using the powerful CRM PowerShell module. Our colleagues, Sean McNellis and Kenichiro Nakamura, implemented this wonderful PowerShell module. Also, Sean published another blog article–Manage Dynamics CRM data and settings with PowerShell! 

    So let’s get started.


    Step 1. Download PowerShell Module

    You can download CRM PowerShell module from Microsoft.Xrm.Data.Powershell: PowerShell for Dynamics CRM Organization Data. Also, you can find more useful information here. 


    Step 2. Unblock

    Once you have successfully downloaded the file, right click the downloaded zip file and click “Properties”. Check “Unblock” checkbox and click “OK”. Depending on your OS versions, you can simply click “Unblock” button.


    Step 3. Extract PowerShell module to the appropriate folder

    You can extract PowerShell module to either User Profile folder or System Wide PowerShell module folder. If you want anyone to use the module on the computer, copy them to System Wide PowerShell module folder. If you do not have the folder, you can manually create them.

    Extract the zip file and copy “Microsoft.Xrm.Data.PowerShell” folder to one of the following folders:
       • %USERPROFILE%\Documents\WindowsPowerShell\Modules
       • %WINDIR%\System32\WindowsPowerShell\v1.0\Modules  

    Following image shows this module copied to System Wide PowerShell module folder.

     

     
    Step 4. Check PowerShell version

    As of writing of this blog article, the Microsoft.Xrm.Data.Powershell module requires PowerShell v4.0, so you should perform a PowerShell version check in your environment. To check your PowerShell version, you can access the PSVersion property from PSVersionTable to determine what version of Windows PowerShell is installed on your computer: $PSVersionTable.PSVersion.

     

     

    Step 5. Set Execution Policy

    The Microsoft.Xrm.Data.Powershell module is not signed, so your next step is to change Execution Policy to load the module. You can do so by executing following command:

    Set-ExecutionPolicy –ExecutionPolicy RemoteSigned –Scope CurrentUser

    Please refer to Set-ExecutionPolicy for more information.

     

    Step 6. Load PowerShell Module

    At this point, you can load Microsoft.Xrm.Data.Powershell module. To load the PowerShell module, you can run the following command:

    Import-Module Microsoft.Xrm.Data.Powershell

     

    Step 7. Connect to CRM Orgnization

    You are almost ready to unleash the power of this awesome module, the last step before you can use it is to create a connection to your CRM organization. You can run the following command to connect to Dynamics CRM Organization via the Xrm Tooling GUI:

    Connect-CrmOnlineDiscovery –InteractiveMode

    This will launch a PowerShell Interactive Login window. This windows gives you the option to connect to Dynamics CRM Online or On-Premise environment. Once you provide necessary information, you are connected to your CRM organization.

     

     

     

    Next Steps

    In Part II of this post, I’ll include additional samples to create a sample account, update the account, then remove the account. We are also going to look at how to make user setting changes via PowerShell.

     

    Related References

    Microsoft.Xrm.Data.Powershell: PowerShell for Dynamics CRM Organization Data

    Manage Dynamics CRM data and settings with PowerShell! 

    Using Windows PowerShell 

     

    Thanks,

    Andy Zhang

    Microsoft Premier Field Engineer

    Viewing all 103 articles
    Browse latest View live




    Latest Images

    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
    <script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>