<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to run filtered views in MS CRM through ASP .NET in a distributed server environment (DB machine different than web server)</title>
	<atom:link href="http://www.changingera.com/2009/08/13/how-to-run-filtered-views-in-ms-crm-through-asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.changingera.com/2009/08/13/how-to-run-filtered-views-in-ms-crm-through-asp-net/</link>
	<description>Fresh Views on Enterprise Software</description>
	<lastBuildDate>Sun, 01 May 2011 15:33:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Spyros Moschovakos</title>
		<link>http://www.changingera.com/2009/08/13/how-to-run-filtered-views-in-ms-crm-through-asp-net/comment-page-1/#comment-2393</link>
		<dc:creator>Spyros Moschovakos</dc:creator>
		<pubDate>Sun, 01 May 2011 15:33:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.changingera.com/?p=336#comment-2393</guid>
		<description>hi,

I&#039;m not sure I understand why you are both calling services and database, but the error indicates that your code is trying to access the crm db with the application pool identity, which probably is a sign that either the anonymous authentication is enabled, or the delegation does not work. You should disable anonymous authentication and leave only &quot;integrated windows&quot; and &quot;impersonation&quot; in your IIS configuration.

If you inject this code in a web page:

    System.Security.Principal.WindowsPrincipal w = Threading.Thread.CurrentPrincipal();
    Response.Write(&quot;&lt;b&gt;connected user is:&lt;/b&gt;&quot; + w.Identity.Name);

and this reports the connected user, then it means that the delegation configuration in AD is wrong. If it reports the application pool identity then this means that the IIS/web.config options are not correctly setup.</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>I&#8217;m not sure I understand why you are both calling services and database, but the error indicates that your code is trying to access the crm db with the application pool identity, which probably is a sign that either the anonymous authentication is enabled, or the delegation does not work. You should disable anonymous authentication and leave only &#8220;integrated windows&#8221; and &#8220;impersonation&#8221; in your IIS configuration.</p>
<p>If you inject this code in a web page:</p>
<p>    System.Security.Principal.WindowsPrincipal w = Threading.Thread.CurrentPrincipal();<br />
    Response.Write(&#8220;<b>connected user is:</b>&#8221; + w.Identity.Name);</p>
<p>and this reports the connected user, then it means that the delegation configuration in AD is wrong. If it reports the application pool identity then this means that the IIS/web.config options are not correctly setup.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mycapi</title>
		<link>http://www.changingera.com/2009/08/13/how-to-run-filtered-views-in-ms-crm-through-asp-net/comment-page-1/#comment-2381</link>
		<dc:creator>mycapi</dc:creator>
		<pubDate>Wed, 27 Apr 2011 13:48:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.changingera.com/?p=336#comment-2381</guid>
		<description>Hi,
i did all this steps, but i still get the error System.Data.SqlClient.SqlException (0x80131904): Login failed for user &#039;appPoolUser&#039;. My code: 

CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = 1;           // Use Active Directory authentication
token.OrganizationName = &quot;ORG&quot;;

CrmService service = new CrmService();
service.Url = &quot;http://crm.org.internal/mscrmservices/2007/CrmServiceWsdl.aspx&quot;;
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

WhoAmIRequest userRequest = new WhoAmIRequest();
Response test = service.Execute(userRequest);    // HERE IS THE ERROR IF RUNNING LOKAL
WhoAmIResponse user = (WhoAmIResponse)test;
token.CallerId = user.UserId;

string conString = String.Empty;

conString = ConfigurationManager.ConnectionStrings[&quot;nameConString&quot;].ConnectionString;
using (SqlConnection con = new SqlConnection(conString))
{
   using (SqlDataAdapter adapter = new SqlDataAdapter(sqlStatememt, conString))
   adapter.Fill(selectResult);
}                   


The connection string: 
  

The only difference is: with  I get an 500 - Internal server error when calling my page

Can anyone help me?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
i did all this steps, but i still get the error System.Data.SqlClient.SqlException (0&#215;80131904): Login failed for user &#8216;appPoolUser&#8217;. My code: </p>
<p>CrmAuthenticationToken token = new CrmAuthenticationToken();<br />
token.AuthenticationType = 1;           // Use Active Directory authentication<br />
token.OrganizationName = &#8220;ORG&#8221;;</p>
<p>CrmService service = new CrmService();<br />
service.Url = &#8220;http://crm.org.internal/mscrmservices/2007/CrmServiceWsdl.aspx&#8221;;<br />
service.CrmAuthenticationTokenValue = token;<br />
service.Credentials = System.Net.CredentialCache.DefaultCredentials;</p>
<p>WhoAmIRequest userRequest = new WhoAmIRequest();<br />
Response test = service.Execute(userRequest);    // HERE IS THE ERROR IF RUNNING LOKAL<br />
WhoAmIResponse user = (WhoAmIResponse)test;<br />
token.CallerId = user.UserId;</p>
<p>string conString = String.Empty;</p>
<p>conString = ConfigurationManager.ConnectionStrings["nameConString"].ConnectionString;<br />
using (SqlConnection con = new SqlConnection(conString))<br />
{<br />
   using (SqlDataAdapter adapter = new SqlDataAdapter(sqlStatememt, conString))<br />
   adapter.Fill(selectResult);<br />
}                   </p>
<p>The connection string: </p>
<p>The only difference is: with  I get an 500 &#8211; Internal server error when calling my page</p>
<p>Can anyone help me?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

