Posts

Showing posts from 2014

Disable CRL Checking in IIS 8

When working on a system with no internet access it is important to ensure that CRL checking is disabled. If not disabled you will always receive a 403.13 error after entering you pin. After a lot of searching I found an article written by Kaushal Kumar Panday. I would suggest you check out his article first, I'm just re-posting some of the commands here for my own use.
Original Article

Also if you are using ip addresses not hostname just change hostnameport to ipport.

Command to Show All Binding and Their Verify Client Certificate Revocation Setting:
netsh http show sslcert
Delete SNI Binding:
netsh http delete sslcert hostnameport=www.mysite.com:443
Add SNI Binding:
netsh http add sslcert hostnameport=www.mysite.com:443 certhash=78dd6cc2bf5785a123654d1d789c530fcb5687c2 appid={3cc2a456-a78c-2cc9-bcc9-782bc83bb789} certstorename=My verifyclientcertrevocation=disable

Postpone CRM Rollup Database Updates

Image
Update Rollup 17 for CRM 2011 creates new indexes for database tables when installed.  Because of this the install can take several hours.  In the case that you have a multitenant environment with separate hardware for each org you may want to defer rolling out database updates to all the orgs so that you can install the update rollup per sever/org pair.To disable the automatic update you can use PowerShell or update the MSCRM_CONFIG database as shown below.Open SQL Server Management StudioExpand the MSCRM_CONFIG databaseRight Click the dbo.DeploymentProperties table and select Edit Top 200 RowsFind the AutomaticallyInstallDatabaseUpdates key and update the BitColumn from True to FalseAfter installing the binary files for UR17 on each server you will then need to go into the CRM Deployment Manager and manually apply the updates for the organization.Start Microsoft Dynamics CRM Deployment ManagerClick on OrganizationsRight click on the organization you wish to update and select the Upd…

Get Process ID of Application Pool (w3wp.exe)

Image
When wanting to debug in VS sometimes I only want to attach to a specific Application Pool.  To find out which Process Id belongs to what Application pool open a Command Prompt and use the following command.

C:\Windows\System32\Inetsrv\> Appcmd list wp
You will get a list of all the running application pools and their process id.




Point Internal Servers to Internal IP for Internet Facing Sub Domain

When you want to create internal DNS entries for a domain name that is also registered externally you can actually create a DNZ zone for that specific sub-domain.

The first thing I had tried was creating a zone for the entire domain, eg external.com.  I then put in A records for the specific sub-domains I wanted.  The issues I had though was that any other sub-domains were unreachable without an A record.

Instead what I did was create a zone for my specific sub-domain, eg sub.external.com.  I then put in an A record with a blank Host Name and entered the IP address of my local server.  This way when my local servers attempt to navigate to anything in the domain.com namespace they will still go to my outside name server unless I have specifically created a zone for the sub-domains I want them to access using internal Urls.


internal.localForward Lookup Zone_msdcs.internal.localinternal.localsub.external.comA Record - Name, (same as parent folder) - Type, Host (A) - Data, 10.0.0.25

CAC Card Authentication Using KCD With CRM 2011 and TMG

CRM

Allow website to use KerberosCreate an SPN for CRMsetspn -a http/crm-2011.test.local Domain/UserAD
Open TMG Computer Account in AD and allow delegation to the SNP you created earlier.
TMG
Install DoD Root Certificates (http://iase.disa.mil/pki-pke/function_pages/tools.html)Install Tumbleweed on TMG Server ***** this is extremely important on gov sites that use this software.  *****Import Tumbleweed client configuration fileDisable HTTPS Inspection and NIS in TMGPublish DoD E-mail certs to the NT Auth Storecertutil -dspublish -f <filename> NTAuthCAMake sure GPO for TMG machine is updated with the following.Policies -> Windows Settings -> Security Settings -> Public Key Policies -> Certificate Services Client - Auto-EnrollmentConfiguration Model should be enabled and Renew expired certificates and Update certificates should both be checked.Create ListenerCreate RuleUnder Authentication Delegation choose Negotiate (Kerberos/NTLM).  In the SPN box enter the one you creat…
Recently I have been working with two plugins in my web pages. DirtyForm, which allows you to detect when changes have been made to fields, and JQueryUI which has a very flexible popup calendar for date fields. One issue i have been having is that the Datepicker does not call the blur even when it's closed which means the DirtyForm plugin doesn't pick up the change. In order to fix this issue I added an onClose handler to my DatePicker selector. DirtyForm: https://github.com/acvwilson/dirty_form
Datepicker: http://jqueryui.com/datepicker/

Update 2014/05/13: I changed from using trigger to triggerHandler as the latter does not re-open the calendar control but still has the same functionality of calling the dirty form handler.

Debug App that Uses ADFS: The SecurityToken is rejected because the validation time is out of range

When debugging an app which connected to CRM using IFD connection I kept getting the following in the trace log. The issue was that debugging the call caused the time the ticket was generated to be off. In order to fix this I utilized a property that allows tickets to be off by a certain amount of time. The PowerShell command below will allow tickets to be out of the time range by 5 minutes.

Could Not Load Type System.ServiceModel .net 4 Web App

While attempting to load a .Net 4 website I kept getting a configuration error and the following item in the Event LogException information:
    Exception type: ConfigurationErrorsException
    Exception message: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.Turns our that IIS didn’t have all the .Net components installed.  To fix this you can run the following command which will update IIS with the correct .Net components.  Didn’t even require a reboot.c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru

Visual Studio Error: The given assembly name or codebase was invalid (HRESULT: 0x80131047)

Image
When attempting to add a reference to a project this error kept appearing.  I though it was because I had switched the project from .Net 3.0 to 3.5 but it turns out it was something else.  The problem turned out to be that the assembly path contained a comma (eg. C:\Libraries\MyLibrary{1-1-14, Customer}).  Once I moved the assembly to C:\Libraries it added correctly.

Pass XRM Ribbon Parameters Using JavaScript Array

Image
Trying to pass the list of selected items from a grid using query parameters has limitations due to restrictions on the size of a URL.  Instead use JavaScript to pass Ribbon parameters to a variable on the XRM page and grab the data in the popup window.Ribbon Command Setup
Here we pass the SelectedControlSelectedItemIds which will pass an object array of all the record ids that are selected on the home grid.Ribbon JavaScript Web Resource
The web resource will data the ids and post them to a new variable in the main XRM window then opens a popup window.AddApplicantsToCourse.htm
This popup page will get the ids from the page that opened it.  In order to do so we need to do the following:

-Include jQuery
-declare the array to hold the id values
-copy the values from the object in the parent page to the array you created

Calculate Date of Birth in SSRS

You can utilize this code in an Expression to find the Date of Birth. =IIF(IsNothing(Fields!dateofbirth.Value), "", IIF( ((Month(Now) - Month(Fields!dateofbirth.Value)) < 0) OR ((Month(Now) - Month(Fields!dateofbirth.Value)) = 0 AND (Day(Now) - Day(Fields!dateofbirth.Value)) < 0), (Year(Now) - Year(Fields!dateofbirth.Value)) - 1, (Year(Now) - Year(Fields!dateofbirth.Value)) ))

Increase CRM Paging Limit for User

Below is an unsupported method for increasing the number of records in each page of a view.  This setting is individual to each users.  In the case below we are updating it for the user related to the DOMAIN\User account.  This is not recommended for normal user but I find it helpful when I need to add 2000 plugin steps to a solution.

UPDATE US
SET US.[PagingLimit] = 1000
FROM [Default_MSCRM].[dbo].[UserSettings] US
LEFT JOIN [Default_MSCRM].[dbo].[SystemUser] SU ON SU.SystemUserId = US.SystemUserId
WHERE SU.[DomainName] like 'DOMAIN\User'

Create SharePoint Buttons on Administration Page

A long time ago I wrote a SharePoint administration page and had used the "Microsoft.SharePoint.Portal.WebControls" dll to create Ok and Cancel buttons at the bottom of the page.  Well I recently had a customer who wanted to use it but only had WSS and the page was erroring out when they tried to load it instead I ended up using another solution from Karine Bosch which is below. Link to original article: http://karinebosch.wordpress.com/sharepoint-controls/buttonsectionascx-control/ To include a ButtonSection control on an application page you have to use the following syntax:<wssuc:ButtonSection runat="server" ShowStandardCancelButton="true">
<template_buttons>
<asp:PlaceHolder runat="server">
<asp:Button id="SubmitButton" UseSubmitBehavior="false" runat="server"class="ms-ButtonHeightWidth"
Text="OK" OnClick="Submi…