<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nathan Bridgewater &#187; Sql Server</title>
	<atom:link href="http://www.integratedwebsystems.com/category/sql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.integratedwebsystems.com</link>
	<description>My Little .NET Sandbox</description>
	<lastBuildDate>Thu, 19 Jan 2012 20:37:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Connecting to Sql Server using Impersonation from Asp.Net</title>
		<link>http://www.integratedwebsystems.com/2009/06/connecting-to-sql-server-using-impersonation-from-asp-net/</link>
		<comments>http://www.integratedwebsystems.com/2009/06/connecting-to-sql-server-using-impersonation-from-asp-net/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 16:13:03 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Sql Server]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Delegation]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.integratedwebsystems.com/?p=276</guid>
		<description><![CDATA[So you have an Asp.Net application that needs to authenticate its users...]]></description>
			<content:encoded><![CDATA[<p>So you have an Asp.Net application that needs to authenticate its users to Active Directory, and you also want to use their credentials for connecting to a database server. It&#8217;s pretty logical thing to do in an enterprise environment where you would normally control all your user privileges using Active Directory. This is especially nice since you also don&#8217;t have to put sensitive credentials in your web.config file. </p>
<p> <span id="more-276"></span>Before I begin, here are a few links worth mentioning:
</p>
<p>How To: Use Impersonation and Delegation in ASP.NET 2.0    <br /><a title="http://msdn.microsoft.com/en-us/library/ms998351.aspx" href="http://msdn.microsoft.com/en-us/library/ms998351.aspx">http://msdn.microsoft.com/en-us/library/ms998351.aspx</a></p>
<p>How To: Use Protocol Transition and Constrained Delegation in ASP.NET 2.0    <br /><a title="http://msdn.microsoft.com/en-us/library/ms998355.aspx" href="http://msdn.microsoft.com/en-us/library/ms998355.aspx">http://msdn.microsoft.com/en-us/library/ms998355.aspx</a></p>
<p>How To: Use Windows Authentication in ASP.NET 2.0    <br /><a title="http://msdn.microsoft.com/en-us/library/ms998358.aspx" href="http://msdn.microsoft.com/en-us/library/ms998358.aspx">http://msdn.microsoft.com/en-us/library/ms998358.aspx</a></p>
<p>This turns out to be a very easy thing to do; it&#8217;s just hard to find any simple information about it. Authenticating to Asp.Net using Windows and using impersonation gives us the ability to let the worker process inherit privileges of the authenticated user. All it takes is a few web.config changes.</p>
<p>First, you need to change authentication mode to Windows. under &lt;system.web&gt; set &lt;authentication mode=&quot;Windows&quot;/&gt;</p>
<p>It&#8217;s also a good idea to force anonymous users to authentication. Do that by changing the &lt;authorization&gt; config.</p>
<p>Now we have users authenticating to the Windows network. Now lets enable impersonation so the worker process will adopt privileges for their requests. Set &lt;identity impersonation=&quot;true&quot;/&gt;</p>
<p>When you’re done, your web.config file should resemble this.</p>
<pre class="brush: xml; toolbar: false;">&lt;system.web&gt;

    &lt;authentication mode=&quot;Windows&quot;/&gt;

    &lt;identity impersonate=&quot;true&quot;/&gt;

    &lt;authorization&gt;
        &lt;deny users=&quot;?&quot;/&gt;
    &lt;/authorization&gt;

&lt;/system.web&gt;</pre>
<p>All that’s left is putting the proper delegation rules in place for your web server to hand out Windows tokens (at least that’s my understanding). In Active Directory Users and Computers from a domain controller or accessible machine, right click and go to the properties of the web server that will be using impersonation.&#160; Click the Delegation tab and select the third option. Trust this computer for delegation to specified services only.&#160; Select Use any authentication protocol.</p>
<p><a href="http://www.integratedwebsystems.com/wp-content/uploads/image10.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" border="0" alt="image" align="right" src="http://www.integratedwebsystems.com/wp-content/uploads/image_thumb.png" width="408" height="470" /></a>Then browse for a machine account for the database server you want to access with the impersonated accounts. Choose the MSSQLSvc with the port number next to it. (Ours had two services).&#160; Then click OK to apply the changes.</p>
<p>You may need to reset IIS or wait a few minutes for the AD changes to propagate. We reset ours from a command line with “iisreset”.</p>
<p>That should be it!&#160; You should now be able to browse your web app and access the database using your AD Windows Account.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.integratedwebsystems.com/2009/06/connecting-to-sql-server-using-impersonation-from-asp-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing a Corrupt Sql Server 2005 Install</title>
		<link>http://www.integratedwebsystems.com/2009/04/fixing-a-corrupt-sql-server-2005-install/</link>
		<comments>http://www.integratedwebsystems.com/2009/04/fixing-a-corrupt-sql-server-2005-install/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 17:14:40 +0000</pubDate>
		<dc:creator>Nathan</dc:creator>
				<category><![CDATA[2005]]></category>
		<category><![CDATA[Sql Server]]></category>
		<category><![CDATA[Install]]></category>

		<guid isPermaLink="false">http://www.integratedwebsystems.com/index.php/2009/04/fixing-a-corrupt-sql-server-2005-install/</guid>
		<description><![CDATA[Okay, so I&#39;ve been fighting with this workstation that has a corrupt...]]></description>
			<content:encoded><![CDATA[<p>Okay, so I&#39;ve been fighting with this workstation that has a corrupt Sql Server 2005 install, and I&#39;m unable to re-install or remove the old install. I&#39;ve tried manually removing registry keys and the whole nine. I even found a few references to articles posted about the topic.</p>
<p>I finally figured it out, so I thought I&#39;d share since I&#39;ve had to do this more than once. My situation is that I have a machine with Sql Management Studio Express installed and I needed the full Management Studio installed. So while uninstalling a few components, I must&#39;ve done it in the wrong order, my Sql Server Add/Remove just disappeared.&nbsp; So then I was unable to cleanly uninstall the software.</p>
<p>When I tried to re-install the client components, I kept getting this error:</p>
<blockquote>
<p>A component that you have specified in the ADD_LOCAL property is already installed. To upgrade the existing component, refer to the template.ini and set the UPGRADE property to the name of the component.</p>
</blockquote>
<p><a href="http://www.integratedwebsystems.com/wp-content/uploads/sqlerr.png"><img alt="sqlerr" src="http://www.integratedwebsystems.com/wp-content/uploads/sqlerr-thumb.png" style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; width: 644px; height: 89px; " /></a></p>
<p>Sounds a bit greek to me.&nbsp; But after a few minutes of reviewing google results for the subject, I found this article.</p>
<p><a href="http://www.techtalkz.com/microsoft-sql-server/163115-uninstall-sql-2005-studio-express-so-i-can-install-sql-2005-t.html" title="http://www.techtalkz.com/microsoft-sql-server/163115-uninstall-sql-2005-studio-express-so-i-can-install-sql-2005-t.html">http://www.techtalkz.com/microsoft-sql-server/163115-uninstall-sql-2005-studio-express-so-i-can-install-sql-2005-t.html</a></p>
<p>In the last post, he mentions that he downloaded the Windows Installer Cleanup Utility and it worked.&nbsp; So I thought I&#39;d give it a whirl since my local install was pretty much a handful of nastiness.&nbsp; So I downloaded the utility from <a href="http://support.microsoft.com/kb/290301" target="_blank">Microsoft&#39;s web site</a>.</p>
<p>After installing, I ran the utility, found the missing add/remove items and removed them.&nbsp; Easy peasy&#8230;</p>
<p>Finally I restarted the Sql 2005 installer as normal, and the Client Components install went through without a problem.</p>
<p>Now I can get some work done&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.integratedwebsystems.com/2009/04/fixing-a-corrupt-sql-server-2005-install/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

