Tuesday, 21 August 2012

Dynamics CRM 2011 take other user share view ownership - workaround

Have you previously come across a user that wants to delete a number of views shared by another user that left the company?

The problem in CRM is that at admin level you can't take ownership of the view assigning this to yourself, because the level of permissions on the security role are only at the user-level.



I have filed an improvement request on Microsoft Dynamics CRM connect website to introduce more flexibility around this, Please vote:
https://connect.microsoft.com/dynamicssuggestions/feedback/details/757204/admin-full-access-to-shared-views

To resolve the problem you could easily reset the user AD password, however in large companies you would have to file a HR form requesting permissions for this, because you will be accessing information owned by someone else in the company.

The workaround for this is quite straight forward and all done on the CRM side.
  1. Create an AD test account
  2. In CRM open the profile of the user that left the company and change the Domain Logon Name to the new test account, press tab, make sure the first and last name loads for the new account and press save, make sure you assign a security role.
  3. Over the IE icon, press SHIFT+Right-Click > Select Run as different user 
  4. Type the credentials of the test account you created on step 1, IE will run under the test account context.
  5. Open CRM and voila your test account took ownership of all the data of the user that left the company
  6. Update the views etc...
  7. Revert the changes back to the user account that left the company by again updating the Domain logon name.
Note: you obviously don't want to do this everyday, the long term solution is to wait on Microsoft to introduce new features around this. Please vote on my feature request above.


Sunday, 19 August 2012

Dynamics CRM 2011 Optimization guide

View the wiki technet article here:  http://social.technet.microsoft.com/wiki/contents/articles/13661.dynamics-crm-2011-quick-optmization-guide.aspx

I've put together a high-level list of optimizations for dynamics CRM to centralise information for myself, and thought sharing would be helpful for someone, I'll keep this list updated as I find more information.
  1. Authentication
  2. IIS
  3. CRM Registry Keys
  4. Database
  5. Outlook Client
  6. Internet Explorer
  7. Email Router
  8. Monitoring
  9. Resources

1. Authentication
The number of authentication request's and authentication challenges takes valuable seconds deteriorating performance.
Resources:


2. IIS

  • AppPool Recycling
    • Configure to recycle after hours.


3. CRM Registry Keys
A number of tweaks can be done on the CRM side to improve performance.
  • You can control the size of the Workflow table by deleting completed Workflows with a registry key, this is a nice way to improve performance on the database side, however this can only be applied if you don't need the workflow history.
    • Name: AsyncRemoveCompletedWorkflows
    • Type: DWORD
    • Value: 1
  • Improve SQL Performance EnableRetrieveMultiple
    • Type: DWORD
    • Value: 2 (Decimal)
    • Fixes a number of issues around the SQL tempdb database and improves performance
    • http://support.microsoft.com/kb/2535245
    • Note that with RU10 the suggested default option is 0 read more on the [1] resource document optimizing and maintaining performance.
  • Disable the email pop-up reminder to speed up load times
    • Name: DisablePendingEmailReminder
    • Type: DWORD
    • Value: 1
  • Set a preferred Domain Controller to speed up AD checks
    • Name: PreferredDC
    • Type: String
    • Value: DC_Name

There are a number of registry keys targeting different types of performance issues and types of environments, Microsoft is now releasing with each update Roll Up a package named:'tools'.This package contains a tool that can implement a number of updates/optimizations which were previously reserved for registry implementations, this way makes it easier to enable optimizations centrally and avoid creating registry keys across multiple front-end servers.

http://support.microsoft.com/kb/2691237
e.g number of registry keys part of RU6
  • DisableSmartMatching
    • Default Value – False
  • AutoCreateContactOnPromote
    • Default Value - True
  • BackgroundSendBatchFile
    • Default Value – 10
  • DisableInactiveRecordFilterForMailMerge
    • Default Value - False
  • LookupNameMatchesDuringImport
    • Default Value - False
  • EnableRetrieveMultipleOptimization
    • Default Value - 1
  • DoNotIgnoreInternalEmailToQueues
    • Default Value - False
  • SkipSuffixOnKBArticles
    • Default Value - False
  • SkipGettingRecordCountForPaging
    • Default Value – False

4. Database


5. Outlook Client
Note: Make sure you enable IIS WCF compression from point 2. IIS

6. Internet Explorer
  • Ensure CRM url is added to the local intranet zone
  • Authentication Options
    • AutoLogon
    • Windows Integrated Authentication
  • Reset Zoom level for new windows and tabs
  • Disk space for temporary internet files
    • 250MB
  • Increase IE connections to the server with Registry Keys


7. Email Router








  • for more information on how to use <proveroverrides> </proveroverrides> go to:
  • http://support.microsoft.com/kb/972150
  • If you have more than 5000 users in your environment you will need to increase email router limits on how many users to load from CRM by setting MaxRowsPerPage on the front-end server:

    • Name: MaxRowsPerPage
    • Type: DWORD
    • Value: Number_of_rows (Decimal)

    8. Monitoring





     8. Resources 


    1. [CRM 2011] Optimizing and Maintaining the Performance of a Microsoft Dynamics CRM 2011 Server Infrastructure. http://www.microsoft.com/en-us/download/details.aspx?id=27139
    2. [CRM 2011] Optimizing and Maintaining Client Performance for Microsoft Dynamics CRM 2011 and CRM Online. http://www.microsoft.com/en-us/download/details.aspx?id=23261
    3. [CRM 4][NB] Security and Authentication in Microsoft Dynamics CRM: Connectivity and Firewall Port Requirements in On-Premise Deployments. http://www.microsoft.com/en-us/download/details.aspx?id=12774
    4. [CRM4][NB] Security and Authentication in Microsoft Dynamics CRM: The Microsoft Dynamics CRM Security Model. http://www.microsoft.com/en-gb/download/details.aspx?id=12108
    5. [CRM4] Outlook Synchronization in Microsoft Dynamics CRM 4.0. http://www.microsoft.com/en-us/download/details.aspx?id=17594
    6. [CRM4] [NB] Offline and Online Synchronization in Microsoft Dynamics CRM. http://www.microsoft.com/en-us/download/details.aspx?id=2737
    7. [CRM4] Sharing Data across Microsoft Dynamics CRM Deployments. http://www.microsoft.com/en-us/download/details.aspx?id=10151
    8. [CRM4] Optimizing and Maintaining Microsoft Dynamics CRM 4.0. http://www.microsoft.com/en-us/download/details.aspx?id=3997
    9. [CRM2011] [Email Router] How to configure the Microsoft Dynamics CRM on-premises and Microsoft Dynamics CRM Online E-mail Router in different deployment scenarios. http://www.microsoft.com/en-us/download/details.aspx?id=21445
    10. [CRM 2011] Deploying Microsoft Dynamics CRM 2011 and CRM Online Solutions from Development through Test and Production Environments. http://www.microsoft.com/en-us/download/details.aspx?id=27824






    Thursday, 2 August 2012

    Dynamics CRM Identifying and troubleshooting performance bottlenecks with Microsoft Network Monitor

    Analyse your Dynamics CRM performance with two great Microsoft tools:
    1. Microsoft Network Monitor is a great tool used to troubleshoot applications and network traffic; Fiddler is probably the only tool you may ever use to troubleshoot traffic and HTTP requests. However if you need something more advanced to troubleshoot and inspect in detail TCP/IP packets you will need Microsoft Network Monitor or may consider Wireshark. 
    2. Microsoft Visual Round Trip Analyzer sits on top of the Network Monitor; it analyses traffic in a friendly format with a graphical representation of the client-server communications and the greatest feature generates a report with scores based on the captured traffic to easily identify network and application bottlenecks.

    Download Network Monitor
    http://www.microsoft.com/en-us/download/details.aspx?id=4865

    Download Microsoft Visual Round Trip Analyzer
    http://www.microsoft.com/en-us/download/details.aspx?id=21462

    1. Capturing Data
    When the software installed open Network Monitor and click New Capture > click play. This will start capturing traffic. When you done, save the captured traffic as a *.cap file.







    You can also Capture data with Microsoft Visual Round Trip Analyzer, press the play button and it will start capturing traffic, however you will only be able to view the data when you stop.

    2. Analysing Data
    Now open the Microsoft Visual Round Trip Analyzer and Open the *.cap file.

    On the first tab, you will see the Main Chart, a graphical representation of the captured activity. The vertical scale shows TCP ports from Client to Server, and horizontal scale shows the time.

    On the below example I've highlighted two ports where the CRM address was used. Each coloured area represents a packet, hovering the mouse over the coloured area displays details of the specific packet.



    Using the Zoom in button, Zoom to port: 59838 and the graph will start looking like this:


    Technical description of the graphical representation.

    On the statistics tab, you can get a breakdown of the traffic per content-type. Also the colours on this tab should represent the colours on the first tab. On the below screenshot you can see 31MB of data for Application/soap+xml; charset=utf-8 this is Outlook client traffic.

    The tab all files, displays all activity per Frame. you can use the frame number as a packet identifier on the network monitor application. Also if you highlight any of the url's on this list, you get detailed information about the packet.


    Identify one of the Frames you want to inspect in more detail from the first column. Open Network Monitor and open the same *.cap file you have loaded onto the Microsoft Visual Round Trip Analyzer. I'm going to pickup the Frame 1620, on the Network Monitor locate the Frame number 1620 and you then should be able to inspect this in greater detail as per the below screenshot:



    3. Identifying Performance Bottlenecks
    Now the interesting Analysis tab, I think this is a great feature, it scores the traffic recorded. The process is simple, the tool analysis the traffic and scores A to F, (good to bad). Displays the results on a list and highlights the scores in different colours (green, orange, red) describing what is being measured and scored. The below screenshots illustrates this feature:

























    Hover the mouse over one of the scores and you get detailed information about the score.


    4. Summary 
    Hope you find this tool and this post useful.
    • Microsoft Network Monitor captures all network traffic on a specific interface
    • *.cap files can be opened by Microsoft Visual Round Trip Analyzer for a more friendly analyse of the traffic
    • Microsoft Visual Round Trip Analyzer built-in feature helps identify network and application performance bottlenecks
    • Identify specific TCP/IP frames to inspect in greater detail within Microsoft Network Monitor

    Saturday, 30 June 2012

    Dynamics CRM 2011 Map solution with OpenStreetMap

    I have seen a few tutorials online regarding how to set up Maps with Google or Bing, however this solutions require a license depending how you use them so why not use a free and powerful opensource map solution on your Dynamics CRM 2011 with OpenStreetMap? And the most interesting part you can do that with only two simple configuration steps.

    OpenStreetMap is a powerfull worldwide map created by volunteers. You can read more here: http://wiki.openstreetmap.org/wiki/Main_Page

    To implement OpenStreetMap on Dynamics CRM 2011 we use the following services:
    • GeoNames (to lookup post codes) -  http://www.geonames.org/
    • OpenLayers (free javascript map library) - http://www.openlayers.org/
    • OpenStreetMap layers
    • Jquery

    Step 1 - Create a HTML webresource
     Navigate to Settings > Customizations > Customize the system > click on web resources and click new.


    Click Text Editor > click tab source > < paste the below code:


    
    
    
    

    When you save it, you can ignore the error messages $. is undefined. Save and Publish.

    Step 2 - Customize your entity
    using the account entity start by creating a new section called map:

    1.  Customize the main Account form, click the insert tab and select One column Section.




















    2. Confirm is set to one column and click OK



























    3. High light the section on the form and go to insert > Webresource and add the osmap_loader


    Click ok, Save and Publish.

    Result

    Open an account make sure the postal code is not empty:




































    You can navigate around, and zoom in and out.




































    Summary
    Hope you enjoyed this tutorial, is pretty straight forward and completely free of charges.


    GeoNames
    The solution above uses the Postal code lookup API from GeoNames however GeoNames have  more API's that can search for addresse's cities etc, lookup GeoNames services here:
    • http://www.geonames.org/
    Note: On the javascript above code I'm using username=nrodri which is my username, you can register an account for free and replace my username. with a custom username the service gives you 30k lookups a day.

    Performance
    Note that I'm loading the jquery library and openlayers library on the form, if you have a heavily customized form, this can add some extra load time, my advise would be to collapse the tab and allow users to expand the map as they needed, this way the map will only be loaded when you expand the tab.


    Friday, 22 June 2012

    Dynamics CRM 2011 Disable Pending E-mail Warning

    I needed to disable the below Pending e-mail warning message which pops-up every time you log on to CRM, I couldn't find online the registry key to disable it, so had to "sniff" the registry keys CRM is loading  and the following key come up:

    Name: DisablePendingEmailReminder
    Type: DWORD
    Value: 1





    Reset IIS.

    Saturday, 16 June 2012

    Dynamics CRM 2011 Report Error 'Sys' is undefined and 'Type' is undefined

    On a load balanced environment with multiple front-end servers users receive intermitent report errros with the following error messages:
    Message: 'Type' is undefined
    Line: 5
    Char: 1
    Code: 0
    URI:...
    Message: 'Sys' is undefined
    Line: 1228
    Char: 1
    Code: 0
     URI: ...
    Message: Object expected
    Line: 993
    Char: 1
    Code: 0
    URI:...

    I found that the reason for the above errors were related with front-end servers configured with different machine keys, when the traffic hits SERVER1 and if the following request's hit SERVER2 the decryption key will be unable to process the request's causing those errors.

    Configure all front-end servers with the same Encryption and Decryption Machine key:

    Open IIS and High light Microsoft Dynamics CRM website

    Double click Machine  Key








    Click on the right generate machine key:

























    Copy those keys onto all front-end servers.

    This should fix the issue. Also confirm you have all SPN's correctly configured for your service accounts.

    Wednesday, 6 June 2012

    Dynamics CRM troubleshooting user access issues

    As time passes, I've realised that in particular with dynamics CRM 4, often I get user account and tenant relationships messed up on the database. CRM fails to create all the user relationships between those tenants. Issues that you may find:
    • User account is visible on the users list and has a security role, however user can't authenticate.
    • You can't assign a security role to a specific user on a specific tenant.
    • User can't connect via Outlook client, with organizationId error.
    • User can't run reports (not a member of ReportingGroup).
    The above situations  are typical symptoms of user and tenant relationships not created on the database. A quick way to troubleshoot and understand how the user account relates with different tenants, is illustrated on the below diagram:




    As you can see above the Organization database links to the SystemUserOrganizations, so this means on the MSCRM_CONFIG you should have one entry for each tenant the user is member of. The diagram can help you to quickly identify User and Tenant relationships.

    Note: for the situation where the user can't run reports, just add the user to the ReportingGroup.

    Hope this was useful :)