<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Ideas &amp; Solutions Etc.</title><link>http://blogs.msdn.com/johnlee/default.aspx</link><description>perception vision dedication inspiration action realization</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Take Consideration of AAM When Coding WebParts</title><link>http://blogs.msdn.com/johnlee/archive/2009/04/28/take-consideration-of-aam-when-coding-webparts.aspx</link><pubDate>Tue, 28 Apr 2009 21:03:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9573944</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/9573944.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=9573944</wfw:commentRss><description>&lt;p&gt;When you code webparts, you really design it carefully and avoid use/expect/demand absolute url in webparts configuration settings, this will make moving from the site from environment to environment less painful and also make it work with AAM. &lt;/p&gt;  &lt;p&gt;Here is one example:&lt;/p&gt;  &lt;p&gt;A webpart that is used to output a few links stored in a list so one of the settings the webpart needs is the siteUrl, which is where the location of the list.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;site = &lt;span class="kwrd"&gt;new&lt;/span&gt; SPSite(siteURL);
web = site.OpenWeb();
SPList spList = web.Lists(ListName);

&lt;span class="kwrd"&gt;foreach&lt;/span&gt; (SPListItem li &lt;span class="kwrd"&gt;in&lt;/span&gt; spList.Items)
{
    &lt;span class="rem"&gt;//construct the link from one of the column with URL data type&lt;/span&gt;
}&lt;/pre&gt;

&lt;p&gt;If you have AAM on this site and you are using the absolute path for siteURL then every access URL will produce link with that hardcoded siteURL. The right way of doing this is to &lt;strong&gt;use relative path for siteUrl and you would get the base address from System.Web.HttpContext.Current and insert the base url in front of relative siteURL.&lt;/strong&gt;&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9573944" width="1" height="1"&gt;</description></item><item><title>Deploy MOSS Medium Farm Using Kerberos Authentication on Windows 2008 Server NLB</title><link>http://blogs.msdn.com/johnlee/archive/2008/11/09/deploy-moss-medium-farm-using-kerberos-authentication-on-windows-2008-server-nlb.aspx</link><pubDate>Sun, 09 Nov 2008 23:59:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9056330</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/9056330.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=9056330</wfw:commentRss><description>&lt;h3&gt;&lt;a name="_Toc213995146"&gt;Architecture of the medium farm&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="432" alt="image" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/image_thumb.png" width="389" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:cb08e29a-d917-4b9f-9458-1c9be699bcc0" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/MOSS%202007" rel="tag"&gt;MOSS 2007&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Kerberos" rel="tag"&gt;Kerberos&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Windwos%202008" rel="tag"&gt;Windwos 2008&lt;/a&gt;,&lt;a href="http://technorati.com/tags/NLB" rel="tag"&gt;NLB&lt;/a&gt;&lt;/div&gt;  &lt;h3&gt;&lt;a name="_Toc213995147"&gt;Assumption&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#183; You have basic knowledge of AD, MOSS and NLB&lt;/p&gt;  &lt;p&gt;&amp;#183; Windows 2003 Domain name: contoso.com&lt;/p&gt;  &lt;p&gt;&amp;#183; SQL cluster already installed&lt;/p&gt;  &lt;p&gt;&amp;#183; 3 servers with Windows 2008 Server installed, Web1 and Web2 has 2 NICs installed and connected to different subnet&lt;/p&gt;  &lt;p&gt;&amp;#183; You have a Domain Admin account&lt;/p&gt;  &lt;p&gt;&amp;#183; 2 Web front servers (Web1 and Web2)&lt;/p&gt;  &lt;p&gt;&amp;#183; 1 Index Server (Idx1)&lt;/p&gt;  &lt;p&gt;&amp;#183; NLB SharePoint farm will be accessed as &lt;a href="http://sharepoint"&gt;http://sharepoint&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#183; Following domain accounts used for SharePoint have been created:&lt;/p&gt;  &lt;p&gt;o Contoso\MOSSPortal&lt;/p&gt;  &lt;p&gt;o Contoso\MOSSSearch&lt;/p&gt;  &lt;p&gt;o Contoso\MOSSMysite&lt;/p&gt;  &lt;p&gt;o Contoso\MOSSAdmin&lt;/p&gt;  &lt;p&gt;o Contoso\MOSSSsp&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc213995148"&gt;Prepare Windows 2008 Servers&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;Make sure all 3 Windows 2008 servers have the following roles added:&lt;/p&gt;  &lt;p&gt;&amp;#183; Application Server Foundation&lt;/p&gt;  &lt;p&gt;&amp;#183; Web Server (IIS) Support&lt;/p&gt;  &lt;p&gt;&amp;#183; Windows Process Activation Service Support (optional &amp;#8211; useful if this server will host WCF service)&lt;/p&gt;  &lt;p&gt;&amp;#183; Distributed Transactions (optional for MOSS but install it in case some WebPart code need to use distributed transaction)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image004_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="397" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image004_thumb.jpg" width="528" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc213995149"&gt;Prepare Windows 2008 Server NLB Cluster&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;This is a very straight forward process and we need to make sure the NLB cluster is functioning before we install MOSS on it. Here is the step by step configuration process:&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon to Web1, make sure the both NIC configured correctly by pinging Web2 (this should resolve 172.168.8.57 in my case), also make sure you can ping Web2 using another IP (in my case it&amp;#8217;s 192.168.10.2)&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon to Web2, make sure the both NIC configured correctly by pinging Web1 (this should resolve 172.168.8.56 in my case), also make sure you can ping Web1 using another IP (in my case it&amp;#8217;s 192.168.10.1)&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon to Web1, from command window, type nlbmgr, right click the Network Load Balancing Clusters and select &amp;#8220;New Cluster&amp;#8221;, specify a host to connect to and select the interface with IP 172.16.8.56, select unicast because we have two NICs here (you need to use multicast if you have only one NIC), make sure to specify your cluster IP (in my case it&amp;#8217;s 172.16.8.58) and full internet name as sharepoint.contoso.com &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image006_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="377" alt="clip_image006" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image006_thumb.jpg" width="519" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image008_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="476" alt="clip_image008" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image008_thumb.jpg" width="512" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image010_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="481" alt="clip_image010" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image010_thumb.jpg" width="517" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image012_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="clip_image012" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image012_thumb.jpg" width="521" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image014_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="480" alt="clip_image014" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image014_thumb.jpg" width="521" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#183; Add Web2 into the cluster and you should see something similar to the following after NLB configured successfully&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc213995150"&gt;Test NLB Cluster by Creating an IIS Website&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;Before we install MOSS to Web1 and Web2, we need to make sure the NLB is functioning as expected and here are steps to do the test.&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon Web1&lt;/p&gt;  &lt;p&gt;o Create a folder to host our test website C:\WebSites\SharePointPortalSite, create a test.htm file in this folder, enter &amp;lt;h1&amp;gt;Content on Web1&amp;lt;/h&amp;gt; in test.htm&lt;/p&gt;  &lt;p&gt;o Create a website using IIS manager point to the above created folder, make sure this website is bound to the cluster IP only and cluster name as host header (in my case it&amp;#8217;s 172.16.8.58 and sharepoint)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image016_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="212" alt="clip_image016" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image016_thumb.jpg" width="503" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;o Select DefaultAppPool as application pool&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon Web2, repeat the above steps but edit the test.htm to change the content to &amp;#8220;Content on Web2&amp;#8221;&lt;/p&gt;  &lt;p&gt;&amp;#183; Now logon to the index server, type &lt;a href="http://sharepoint"&gt;http://sharepoint&lt;/a&gt;, you should see either &amp;#8220;Content on Web1&amp;#8221; or &amp;#8220;Content on Web2&amp;#8221;&lt;/p&gt;  &lt;p&gt;&amp;#183; Keep testing by shutting down Web1 while Web2 is on&lt;/p&gt;  &lt;p&gt;&amp;#183; Keep testing by shutting down Web2 while Web2 is on&lt;/p&gt;  &lt;p&gt;We have successfully tested the NLB cluster. You might get authentication error if you access the &lt;a href="http://sharepoint"&gt;http://sharepoint&lt;/a&gt; from either Web1 or Web2, if so, please following this link to see the workaround (Disableloopbackcheck): &lt;a href="http://support.microsoft.com/default.aspx/kb/926642"&gt;http://support.microsoft.com/default.aspx/kb/926642&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc213995151"&gt;Install MOSS and Configure Central Admin Site&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#183; Install MOSS bits on all 3 servers in the following order:&lt;/p&gt;  &lt;p&gt;o MOSS bits&lt;/p&gt;  &lt;p&gt;o MOSS sp1 bits&lt;/p&gt;  &lt;p&gt;o MOSS infrastructure update bits&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon Web1&lt;/p&gt;  &lt;p&gt;o Run &amp;#8220;SharePoint Products and Technologies Configuration Wizard&amp;#8221; to create your farm&lt;/p&gt;  &lt;p&gt;o Make sure to select &amp;#8220;Central Admin&amp;#8221; will run on this machine&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon Web2&lt;/p&gt;  &lt;p&gt;o Run &amp;#8220;SharePoint Products and Technologies Configuration Wizard&amp;#8221; to join existing farm&lt;/p&gt;  &lt;p&gt;o Make sure to select &amp;#8220;Central Admin&amp;#8221; will run on this machine&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon Idx1&lt;/p&gt;  &lt;p&gt;o Run &amp;#8220;SharePoint Products and Technologies Configuration Wizard&amp;#8221; to join existing farm&lt;/p&gt;  &lt;p&gt;o Make sure to select &amp;#8220;Central Admin&amp;#8221; will run on this machine&lt;/p&gt;  &lt;p&gt;&amp;#183; Test on all 3 servers and make sure the Central Admin site comes up&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc213995152"&gt;Configure Index Server&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#183; Logon to Index server&lt;/p&gt;  &lt;p&gt;&amp;#183; Start Office SharePoint Server Search service&lt;/p&gt;  &lt;p&gt;&amp;#183; Start Windows SharePoint Services Help Search services&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image018_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="293" alt="clip_image018" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image018_thumb.jpg" width="530" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc213995153"&gt;Configure SSP&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#183; Create an application &lt;a href="http://sharepoint:5100"&gt;http://sharepoint:5100&lt;/a&gt; to host SSP, app pool identity: Contoso\MOSSMysite&lt;/p&gt;  &lt;p&gt;&amp;#183; Create an application &lt;a href="http://sharepoint:5200"&gt;http://sharepoint:5200&lt;/a&gt; to host MySite, app pool identity: Contoso\MOSSSsp&lt;/p&gt;  &lt;p&gt;&amp;#183; Make sure to the correct index server, in my case IDX1&lt;/p&gt;  &lt;p&gt;&amp;#183; Plan the index capacity and make sure allocate enough space to host index&lt;/p&gt;  &lt;p&gt;&amp;#183; Create new SSP&lt;/p&gt;  &lt;p&gt;&amp;#183; Configure Search Settings&lt;/p&gt;  &lt;p&gt;&amp;#183; Installed 64bit IFilter on Index Server (&lt;a href="http://www.foxitsoftware.com/pdf/ifilter/"&gt;http://www.foxitsoftware.com/pdf/ifilter/&lt;/a&gt; )&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc213995154"&gt;Prepare for Kerberos Authentication&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;To make Kerberos authentication work with SharePoint portal &lt;a href="http://sharepoint"&gt;http://sharepoint&lt;/a&gt; we need to make sure that both web servers are configured to be trusted for delegation and needed Service Principals are registered.&lt;/p&gt;  &lt;p&gt;Launch Active Directory Users and Computers MMC, find the Web1 and Web2 server, and double click to go to the properties, at Delegation tab, select &amp;#8220;Trust this computer for delegation to any service (Kerberos only)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image020_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="456" alt="clip_image020" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image020_thumb.jpg" width="398" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Find the domain user account contoso\mossportal which will be used as identity of the application pool for our SharePoint portal site and double click to go to properties page, go to Delegation tab, select &amp;#8220;Trust this user for delegation to any service (Kerberos only)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image022_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="499" alt="clip_image022" src="http://blogs.msdn.com/blogfiles/johnlee/WindowsLiveWriter/DeployMOSSMediumFarmUsingKerberosAuthent_B46F/clip_image022_thumb.jpg" width="398" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here are commands we need to run on a machine that has SETSPN.exe (which is included in Windows 2003 Server media as Support.CAB):&lt;/p&gt;  &lt;p&gt;Setspn &amp;#8211;a http/sharepoint contoso\mossportal&lt;/p&gt;  &lt;p&gt;Setspn &amp;#8211;a http/sharepoint.contoso.com contoso\mossportal&lt;/p&gt;  &lt;h3&gt;&lt;a name="_Toc213995155"&gt;Configure MOSS Portal Using Kerberos Authentication&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;&amp;#183; Logon to Web1, launch Central Admin site, create new application, make sure to check &amp;#8220;using an existing IIS website&amp;#8221; and select the website we tested the NLB in above steps, in my case, &lt;a href="http://sharepoint"&gt;http://sharepoint&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#183; Make sure to choose &amp;#8220;Kerberos&amp;#8221; as authentication provider and supply all other necessary information to create a web application&lt;/p&gt;  &lt;p&gt;&amp;#183; Create the root site collection and select one site template meet your need&lt;/p&gt;  &lt;p&gt;&amp;#183; Wait for few minutes to make sure the site provisioning job completed and changes will be made automatically on Web2 server&lt;/p&gt;  &lt;p&gt;&amp;#183; Logon to a workstation, you should be able to access the SharePoint site by the NLB url &lt;a href="http://sharepoint"&gt;http://sharepoint&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9056330" width="1" height="1"&gt;</description></item><item><title>MSDTC on Virtual Machines</title><link>http://blogs.msdn.com/johnlee/archive/2008/09/09/msdtc-on-virtual-machines.aspx</link><pubDate>Wed, 10 Sep 2008 00:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8937455</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/8937455.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=8937455</wfw:commentRss><description>&lt;p&gt;Server virtualization technology has been adopted by more and more companies and some network engineers do not follow Microsoft &lt;a href="http://www.microsoft.com/technet/prodtechnol/virtualserver/2005/proddocs/vs_operate_Best_practices.mspx?mfr=true"&gt;guideline/best practices&lt;/a&gt; to create virtual machine hard disks by simply copy the virtual hard disks and then rename the machine name. &lt;a href="http://support.microsoft.com/?kbid=162001"&gt;This is not supported way of duplicating virtual machine&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;I spent fair amount of hours to identify one of the MSDTC issue for my client on one of their virtual machines. I spot the issue until I used the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5e325025-4dcd-4658-a549-1d549ac17644&amp;amp;DisplayLang=en"&gt;DTCPing tool&lt;/a&gt; and the ping is successful but when you look at the log file, it contains some information like following:&lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;WARNING:the CID values for both test machines are the same      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; while this problem won't stop DTCping test, MSDTC will fail for this&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;After I fixed the duplicate CID issue followed the instructions number 11 in &lt;a title="http://support.microsoft.com/kb/306843" href="http://support.microsoft.com/kb/306843"&gt;http://support.microsoft.com/kb/306843&lt;/a&gt; MSDTC worked correctly.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8937455" width="1" height="1"&gt;</description></item><item><title>Validate EDI Instance Data</title><link>http://blogs.msdn.com/johnlee/archive/2008/07/17/validate-edi-instance-data.aspx</link><pubDate>Thu, 17 Jul 2008 22:30:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8744792</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/8744792.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=8744792</wfw:commentRss><description>&lt;p&gt;I was trying to validate an instance of X12 4010 867 file in VS.NET 2005 IDE and could not get it work correctly using the schema shipped with BizTalk Server 2006 R2. After several tries and struggles, Here is what I did to make it work:&lt;/p&gt;  &lt;p&gt;1. You need to remove the ISA/GS ... GE/IEA from the instance document.&lt;/p&gt;  &lt;p&gt;2. If the Segment teminator is ^, which is the default for Repetition Separator then you need to fake out an repetition separator which is not inside your edi file and then specify the ^ as your segment terminator.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8744792" width="1" height="1"&gt;</description></item><item><title>URL That Will Open InfoPath Form in Browser</title><link>http://blogs.msdn.com/johnlee/archive/2008/07/14/url-that-will-open-infopath-form-in-browser.aspx</link><pubDate>Tue, 15 Jul 2008 08:51:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8732659</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/8732659.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=8732659</wfw:commentRss><description>&lt;p&gt;If you ever need to send out a link of InfoPath form in email and want the link to open the form in browser instead of popup the xml in open/save dialog ... here is the trick:&lt;/p&gt;  &lt;p&gt;send the link as following:&lt;/p&gt;  &lt;p&gt;siteUrl/_layouts/FormServer.aspx?xmlLocation=InfoPathFormUrl?DefaultItemOpen=1&lt;/p&gt;  &lt;p&gt;make sure the InfoPath form Url is UrlEncoded.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8732659" width="1" height="1"&gt;</description></item><item><title>Setting BDC Permissions</title><link>http://blogs.msdn.com/johnlee/archive/2008/07/14/setting-bdc-permissions.aspx</link><pubDate>Tue, 15 Jul 2008 07:47:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8732610</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/8732610.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=8732610</wfw:commentRss><description>&lt;p&gt;You need to set BDC permission at application level AND also entity level otherwise you would spend lots of time figuring out why you got error like 'You do not have permission to access ...' or 'Unable to connect to ... '&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8732610" width="1" height="1"&gt;</description></item><item><title>Move WSS3.0/MOSS2007 Databases To Different Server</title><link>http://blogs.msdn.com/johnlee/archive/2008/03/09/move-wss3-0-moss2007-databases-to-different-server.aspx</link><pubDate>Mon, 10 Mar 2008 02:21:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8119439</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/8119439.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=8119439</wfw:commentRss><description>&lt;p&gt;Recently I had to move all databases including the content database in a MOSS 2007 farm from one SQL server to another. I tried few methods and found the following steps are the easiest:&lt;/p&gt;  &lt;p&gt;[Assumption: All databases in the farm are on one SQL server and the SQL server was not assigned to any other roles]&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Quiesce the farm ... make sure no one is accessing the farm &lt;/li&gt;    &lt;li&gt;List all databases in the farm (&lt;a title="http://blogs.msdn.com/johnlee/archive/2008/03/09/list-all-databases-in-a-moss-2007-farm.aspx" href="http://blogs.msdn.com/johnlee/archive/2008/03/09/list-all-databases-in-a-moss-2007-farm.aspx"&gt;http://blogs.msdn.com/johnlee/archive/2008/03/09/list-all-databases-in-a-moss-2007-farm.aspx&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Detach all databases from the above list &lt;/li&gt;    &lt;li&gt;Copy all databases to another SQL server and attach all of them &lt;/li&gt;    &lt;li&gt;Go to one of Web Front End (WFE) server      &lt;ul&gt;       &lt;li&gt;Launch regedit and navigate to the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB, double click the dsn and change the Data Source from the original SQL Server name to new SQL Server name &lt;/li&gt;        &lt;li&gt;Run &lt;strong&gt;stsadm.exe -o renameserver -oldservername &amp;lt;OldSQLServerName&amp;gt; -newservername &amp;lt;NewSQLServerName&amp;gt;&lt;/strong&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Repeat step 5 on all WFE and other servers except the SQL server &lt;/li&gt;    &lt;li&gt;Reboot all servers except the SQL server &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;[Assumption: WSS/MOSS was installed on a single box - the new SQL server name will be &amp;quot;NewSQL&amp;quot;]&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Introduce the new SQL server (&amp;quot;NewSQL&amp;quot;) into this farm by creating a web application pointed to the new SQL Server&lt;/li&gt;    &lt;li&gt;Quiesce the farm ... make sure no one is accessing the farm &lt;/li&gt;    &lt;li&gt;List all databases in the farm (&lt;a title="http://blogs.msdn.com/johnlee/archive/2008/03/09/list-all-databases-in-a-moss-2007-farm.aspx" href="http://blogs.msdn.com/johnlee/archive/2008/03/09/list-all-databases-in-a-moss-2007-farm.aspx"&gt;http://blogs.msdn.com/johnlee/archive/2008/03/09/list-all-databases-in-a-moss-2007-farm.aspx&lt;/a&gt;) &lt;/li&gt;    &lt;li&gt;Detach all databases from the above list &lt;/li&gt;    &lt;li&gt;Copy all databases to a NewSQL server and attach all of them&lt;/li&gt;    &lt;li&gt;Open SSMS, pointed to configuration database, run the following script to get the Id for the &amp;quot;NewSQL&amp;quot; and record the ID, let's refer it as &amp;quot;InstanceID_GUID&amp;quot;&lt;/li&gt;    &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;select&lt;/span&gt; ID &lt;span class="kwrd"&gt;from&lt;/span&gt; objects 
&lt;span class="kwrd"&gt;where&lt;/span&gt; parentid = (
    &lt;span class="kwrd"&gt;select&lt;/span&gt; Id &lt;span class="kwrd"&gt;from&lt;/span&gt; objects 
    &lt;span class="kwrd"&gt;where&lt;/span&gt; name = &lt;span class="str"&gt;'NewSQL'&lt;/span&gt;)&lt;/pre&gt;
  &lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

  &lt;li&gt;Since all roles are assigned to single server so I could not use stsadm.exe renameserver command to achieve the same goal. What I did is to run the following script to update the parentID of all databases to above instance Guid&lt;/li&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;UPDATE&lt;/span&gt; objects 
&lt;span class="kwrd"&gt;SET&lt;/span&gt; parentid = &lt;span class="str"&gt;'InstanceID_GUID'&lt;/span&gt; 
&lt;span class="kwrd"&gt;WHERE&lt;/span&gt; id &lt;span class="kwrd"&gt;IN&lt;/span&gt; 
(
    &lt;span class="kwrd"&gt;SELECT&lt;/span&gt; o.id 
    &lt;span class="kwrd"&gt;FROM&lt;/span&gt; objects o
        &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; classes c &lt;span class="kwrd"&gt;on&lt;/span&gt; c.id = o.classid     
    &lt;span class="kwrd"&gt;WHERE&lt;/span&gt; c.Fullname &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="str"&gt;'%Administration.SPConfigurationDatabase%'&lt;/span&gt;
    &lt;span class="kwrd"&gt;OR&lt;/span&gt; c.Fullname &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="str"&gt;'%Administration.SPContentDatabase%'&lt;/span&gt;
)&lt;/pre&gt;
  &lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

  &lt;li&gt;Go to one of Web Front End (WFE) server &lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;Launch regedit and navigate to the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB, double click the dsn and change the Data Source from the original SQL Server name to new SQL Server name &lt;/li&gt;

    &lt;li&gt;&lt;/li&gt;
  &lt;/ul&gt;

  &lt;li&gt;Repeat step 9 on all WFE and other servers except the SQL server &lt;/li&gt;

  &lt;li&gt;Reboot all servers except the SQL server&lt;/li&gt;

  &lt;li&gt;Change the &amp;quot;Default database server&amp;quot; from Central Administration to &amp;quot;NewSQL&amp;quot;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;font color="#ff0000"&gt;&lt;strong&gt;[Disclaimer] The methods stated above are just how I did and provided as is for informational purpose only and I have not tested them in production environment and do not know if they are supported methods.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8119439" width="1" height="1"&gt;</description></item><item><title>List All Databases In A MOSS 2007 Farm</title><link>http://blogs.msdn.com/johnlee/archive/2008/03/09/list-all-databases-in-a-moss-2007-farm.aspx</link><pubDate>Sun, 09 Mar 2008 23:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8118729</guid><dc:creator>John Lee</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/8118729.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=8118729</wfw:commentRss><description>&lt;p&gt;Run the following script in the content database:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; o.[Name] &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;span class="str"&gt;'DatabaseName'&lt;/span&gt;,
    Instance.[Name] &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;span class="str"&gt;'DatabaseInstance'&lt;/span&gt;,
    [Server].[Name] &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;span class="str"&gt;'DatabaseServer'&lt;/span&gt;
&lt;span class="kwrd"&gt;FROM&lt;/span&gt; Objects &lt;span class="kwrd"&gt;AS&lt;/span&gt; o
    &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; classes c &lt;span class="kwrd"&gt;on&lt;/span&gt; c.id = o.classid     
    &lt;span class="kwrd"&gt;LEFT&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; Objects &lt;span class="kwrd"&gt;AS&lt;/span&gt; Instance &lt;span class="kwrd"&gt;ON&lt;/span&gt; o.ParentId = Instance.Id
    &lt;span class="kwrd"&gt;LEFT&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; [Objects] &lt;span class="kwrd"&gt;AS&lt;/span&gt; [Server] &lt;span class="kwrd"&gt;ON&lt;/span&gt; Instance.ParentId = [Server].Id
    &lt;span class="kwrd"&gt;WHERE&lt;/span&gt; c.Fullname &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="str"&gt;'%Administration.SPConfigurationDatabase%'&lt;/span&gt;
    &lt;span class="kwrd"&gt;OR&lt;/span&gt; c.Fullname &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="str"&gt;'%Administration.SPContentDatabase%'&lt;/span&gt;
    &lt;span class="kwrd"&gt;OR&lt;/span&gt; c.Fullname &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="str"&gt;'%Administration.SharedDatabase%'&lt;/span&gt;
    &lt;span class="kwrd"&gt;OR&lt;/span&gt; c.Fullname &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="str"&gt;'%Administration.SearchSharedDatabase%'&lt;/span&gt;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="str"&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;



.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8118729" width="1" height="1"&gt;</description></item><item><title>Global Tax Refund</title><link>http://blogs.msdn.com/johnlee/archive/2008/01/02/global-tax-refund.aspx</link><pubDate>Thu, 03 Jan 2008 02:18:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6960588</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/6960588.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=6960588</wfw:commentRss><description>&lt;p&gt;This is something off topic ... some experience in Italy.&lt;/p&gt; &lt;p&gt;When you purchase certain amount of item in European countries you are entitled to get the 12% VAT tax refund when you leave the last European country ... sounds terrific idea, right?&lt;/p&gt; &lt;p&gt;In reality, it's very hard to get it because you can only do it at the airport where you are leaving Europe, you need to get the receipt stamped at the custom with your original item checked, you might need to find out where is the refund counter and most importantly, you might not have enough time between your international flights ...&lt;/p&gt; &lt;p&gt;My wife and I enjoyed our Christmas vacation in Venice and Rome and we did buy some items ... we could not get the tax refund a Rome airport and we can only get the receipt stamped in Frankfurt airport ... our flight delayed so we have barely 1.5 hours, when we got there we asked where the tax refund office was and we got different answers from different people so we just walked around with all of baggage ... from terminal A to terminal B and finally found the custom office for tax refund ... I saw one lady came out of the custom office in tears and I asked her what happened, she told me that it took her more than one hour to find this custom office and she almost gave up the tax refund!!! &lt;/p&gt; &lt;p&gt;We managed to get our refund and get on our airplane back SFO ... It's been a while I travel outside US and when I got home I felt I do not have any complaint anymore, home sweet home and US is the best country to live in.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6960588" width="1" height="1"&gt;</description></item><item><title>BizTalk MQSC Adapter</title><link>http://blogs.msdn.com/johnlee/archive/2008/01/02/biztalk-mqsc-adapter.aspx</link><pubDate>Thu, 03 Jan 2008 01:55:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6960365</guid><dc:creator>John Lee</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/6960365.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=6960365</wfw:commentRss><description>&lt;p&gt;Previously, server based BizTalk adapter was used to access MQ Series and that requires MQ series server on Windows as intermediate server between BizTalk Server and non-Windows Queue Managers. In some situation, when installing the MQAgent to Windows MQ Series box is not an option the &lt;a href="http://technet.microsoft.com/en-us/library/aa772116.aspx" target="_blank"&gt;client based BizTalk adapter (MQSC)&lt;/a&gt; is needed to achieve the same goal.&amp;nbsp; &lt;/p&gt; &lt;p&gt;MQSC is not part of BizTalk bits but it can be found in Host Integration Server 2006.&lt;/p&gt; &lt;p&gt;While setting up MQSC adapter, here are some of the tips when authorization issues occurred (Thanks Tom Canter on this):&lt;/p&gt; &lt;p&gt;1. If MQSeries server box and BizTalk Server box are in the same domain&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Configure the MQSC receive/send adapter using a host instance with domain account as logon account&lt;/li&gt; &lt;li&gt;Add this domain account to domain security group: "&amp;lt;YourDomainName&amp;gt;\Domain MQM" &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;2. If MQSeries server box and BizTalk Server box are NOT member server of any domain&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Create a username on both BizTalk Server box and MQ Series server box with identical username and password&lt;/li&gt; &lt;li&gt;Add the above created account into local group "mqm" on BizTalk server and MQSeries server&lt;/li&gt; &lt;li&gt;Configure the MQSC receive/send adapter using a host instance with the above created username as logon account&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6960365" width="1" height="1"&gt;</description></item><item><title>San Diego Fires</title><link>http://blogs.msdn.com/johnlee/archive/2007/10/22/san-diego-fires.aspx</link><pubDate>Tue, 23 Oct 2007 06:08:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5614805</guid><dc:creator>John Lee</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/5614805.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=5614805</wfw:commentRss><description>&lt;p&gt;This is the first time I experience this type mandatory evacuation ... around 6AM this morning, reverse 911 call notified us to evacuate immediately.&lt;/p&gt; &lt;p&gt;Sitting in a corp. office at High Bluff Drive offered by my former boss, listening to the AM 600, surfing the net to check the fire conditions ... air condition is pretty bad and we can smell the smoke inside the office.&lt;/p&gt; &lt;p&gt;There&amp;nbsp;is 50% chance that my home was burned but we are safe, my dog is with us and our two birds are with us too ... but I felt so sorry that I left my 4 fishes at home.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5614805" width="1" height="1"&gt;</description></item><item><title>{"value does not fall within the expected range."} error</title><link>http://blogs.msdn.com/johnlee/archive/2007/08/15/value-does-not-fall-within-the-expected-range-error.aspx</link><pubDate>Thu, 16 Aug 2007 08:55:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4410666</guid><dc:creator>John Lee</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/4410666.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=4410666</wfw:commentRss><description>&lt;p&gt;When I use the object model to add item to MOSS 2007 project task list, I have some code like following:&lt;/p&gt; &lt;p&gt;const string SitePath = "&lt;a href="http://litwareserver:5000&amp;quot;;"&gt;http://litwareserver:5000";&lt;/a&gt;&lt;br&gt;const string ListName = "ProjectTask";  &lt;p&gt;// enter object model through site collection.&lt;br&gt;SPSite siteCollection = new SPSite(SitePath);  &lt;p&gt;// obtain reference to top-level site.&lt;br&gt;SPWeb site = siteCollection.RootWeb;&lt;br&gt;site.AllowUnsafeUpdates = true;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //needed since my code will be running as web service &lt;p&gt;SPList myList = site.Lists[ListName];&lt;br&gt;if (myList != null)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPListItem item = myList.Items.Add();  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; item["Title"] = "test item";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;&lt;font color="#ff0000"&gt;item["PercentageComplete"] = 0.2; // 20%&lt;/font&gt;&lt;/strong&gt;&amp;nbsp; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; item.Update();&lt;br&gt;}  &lt;p&gt;// clean up by calling Dispose.&lt;br&gt;site.Dispose();&lt;br&gt;siteCollection.RootWeb.Dispose();&lt;br&gt;siteCollection.Dispose();  &lt;p&gt;I got the "value does not fall within the expected range." error&lt;/p&gt; &lt;p&gt;By looking at this error message, my&amp;nbsp;first reaction was&amp;nbsp;to check&amp;nbsp;the percentage complete column, it&amp;nbsp;has min (0) and max (1) defined, 0.2 shall be within the range, anyway, I tried&amp;nbsp;20, 0, 1 and lots&amp;nbsp;of other values,&amp;nbsp;same error; &lt;/p&gt; &lt;p&gt;Then I wanted to reproduce it with a custom list so I created a new list with a&amp;nbsp;field with&amp;nbsp;min/max&amp;nbsp;values defined,&amp;nbsp;I could add items&amp;nbsp;with values inside the range and also outside the range. &lt;/p&gt; &lt;p&gt;I could not reproduce it with custom list. What could be the issue? What's the difference between my custom list and the project task list?&amp;nbsp;Is it possible the&amp;nbsp;field (% complete) in project task list was defined in the content type? &lt;/p&gt; &lt;p&gt;Then I created a content type that has a field with min/max values defined and attached this content type to a new list, removed the original item content type from the list, tested it again, I could add item to the new list with values inside or outside the defined range. So it's not because it's defined in content type ...&amp;nbsp;this made me wonder what could be the problem???&lt;/p&gt; &lt;p&gt;I decided to&amp;nbsp;print out the internal name and other properties&amp;nbsp;of each fields and&amp;nbsp;found out the internal name of field (% complete) is "&lt;strong&gt;&lt;font color="#ff0000"&gt;percent&lt;/font&gt;&lt;/strong&gt;Complete" instead of "&lt;strong&gt;&lt;font color="#ff0000"&gt;percentage&lt;/font&gt;&lt;/strong&gt;Complete"&amp;nbsp;- I fixed the&amp;nbsp;problem right away.&lt;/p&gt; &lt;p&gt;What I&amp;nbsp;learned from this debugging process?&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;1. Do not assume anything.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;2. Do not be fooled by error message.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;3. Product error message should contain&amp;nbsp;meaningful&amp;nbsp;and specific information to help identifying the problem.&lt;/font&gt;&lt;/strong&gt; &lt;/p&gt; &lt;p&gt;The error message should be the classic "index is out of range" or even better "Cannot find the field name '{0}'"&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4410666" width="1" height="1"&gt;</description></item><item><title>WaitHandle.WaitAll For Multiple Handles on a STA Thread Is Not Supported</title><link>http://blogs.msdn.com/johnlee/archive/2007/07/10/waithandle-waitall-for-multiple-handles-on-a-sta-thread-is-not-supported.aspx</link><pubDate>Wed, 11 Jul 2007 06:18:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3808530</guid><dc:creator>John Lee</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/3808530.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=3808530</wfw:commentRss><description>&lt;p&gt;While developing WinForm application, if you need to spawn multiple threads to work on different tasks and you need to wait all threads to complete ... then you might think to use the following approach:&lt;/p&gt; &lt;p&gt;&amp;gt;&amp;gt;&amp;gt; Create an array of &lt;font color="#0000ff"&gt;AutoResetEvent&lt;/font&gt;; use &lt;font color="#0000ff"&gt;ThreadPool&lt;/font&gt;.QueueUserWorkerItem to spawn each task in&amp;nbsp;different thread; then call &lt;font color="#0000ff"&gt;WaitHandle&lt;/font&gt;.WaitAll(AutoResetEvent[]) to wait all threads to complete the task&lt;/p&gt; &lt;p&gt;WinForm app is attributed&amp;nbsp;as [&lt;font color="#008080"&gt;STAThread&lt;/font&gt;] and you will get "&lt;font color="#ff0000"&gt;WaitAll&amp;nbsp;For Multiple&amp;nbsp;Handles on a STA&amp;nbsp;Thread&amp;nbsp;Is Not Supported&lt;/font&gt;" error ... what's the solution? Here is what I used for this scenario:&lt;/p&gt; &lt;p&gt;&amp;gt;&amp;gt;&amp;gt; Create a &lt;font color="#0000ff"&gt;ManualResetEvent&lt;/font&gt;; maintain a TaskCounter; use &lt;font color="#0000ff"&gt;ThreadPool&lt;/font&gt;.QueueUserWorkerItem to spawn each task in different thread; Call &lt;font color="#0000ff"&gt;ManualResetEvent&lt;/font&gt;.WaitOne(); Decrement the TaskCounter after each task is completed and Call &lt;font color="#0000ff"&gt;ManualResetEvent&lt;/font&gt;.Set()&amp;nbsp;when the TaskCounter == 0&lt;/p&gt; &lt;p&gt;Special notes: In your DoTask(object stateInfo), you need to handle exception properly and make sure the TaskCounter is subtracted&amp;nbsp;should there is an exception&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3808530" width="1" height="1"&gt;</description></item><item><title>Workaround to Search Results RSS URL Shows Internal Links</title><link>http://blogs.msdn.com/johnlee/archive/2007/06/28/workaround-to-search-results-rss-url-shows-internal-links.aspx</link><pubDate>Thu, 28 Jun 2007 19:05:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3586369</guid><dc:creator>John Lee</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/3586369.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=3586369</wfw:commentRss><description>&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;If you have a public facing site built on MOSS 2007 you normally would have two zones defined: default zone that&amp;nbsp;is your local intranet and Internet zone that's your public facing zone. In Alternate Access Mapping, you would put something like&amp;nbsp;&lt;a href="http://servername"&gt;http://servername&lt;/a&gt; in the default zone and put &lt;a href="http://www.publicdomainname.com"&gt;http://www.publicdomainname.com&lt;/a&gt; in your Internet zone;&amp;nbsp;then you would create a content source to crawl your site as &lt;a href="http://servername"&gt;http://servername&lt;/a&gt; to if you&amp;nbsp;want&amp;nbsp;all documents stored in list&amp;nbsp;to be crawled.&amp;nbsp;This works very well but there is one area that the internal URL will be shown:&lt;/p&gt; &lt;p&gt;Enter something in the search box,&amp;nbsp;click search, on the search result page, if you have RSS turned on, you would see an RSS link to allow you to subscribe the search result feed. Click on the RSS link icon, you would see all URLs are shown as internal &lt;a href="http://servername"&gt;http://servername&lt;/a&gt; &amp;nbsp;&lt;/p&gt; &lt;p&gt;This is a&amp;nbsp;bug&amp;nbsp;- because&amp;nbsp;the specific&amp;nbsp;WebPart always get URL from default zone.&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Workaround:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Go to Alternate Access Mapping, public the public facing URL into the default zone and put your local intranet URL into custom zone.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3586369" width="1" height="1"&gt;</description></item><item><title>Tips and Tricks From MOSS 2007 Development Training</title><link>http://blogs.msdn.com/johnlee/archive/2007/06/24/tips-tricks-from-moss-2007-development-training.aspx</link><pubDate>Mon, 25 Jun 2007 06:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3509998</guid><dc:creator>John Lee</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/johnlee/comments/3509998.aspx</comments><wfw:commentRss>http://blogs.msdn.com/johnlee/commentrss.aspx?PostID=3509998</wfw:commentRss><description>&lt;UL&gt;
&lt;LI&gt;General&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;do not change identity account of application pool that is used by WSS v3 from ISS mgr, change it from WSS admin site&lt;/LI&gt;
&lt;LI&gt;if something needs to be accessible to all sites, deploy to _layout\[yourCompanyName] folder&lt;/LI&gt;
&lt;LI&gt;get CAML IntelliSense by create a file named as sharepoint_catalog.xml contains the following &lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;lt;SchemaCatalog xmlns="&lt;A href="http://schemas.microsoft.com/xsd/catalog%22" mce_href='http://schemas.microsoft.com/xsd/catalog"'&gt;http://schemas.microsoft.com/xsd/catalog"&lt;/A&gt;&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Schema href="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd" targetNamespace="&lt;A href="http://schemas.microsoft.com/sharepoint/%22" mce_href='http://schemas.microsoft.com/sharepoint/"'&gt;http://schemas.microsoft.com/sharepoint/"&lt;/A&gt; /&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;/SchemaCatalog&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;and copy this file to the following folder C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas\&lt;/P&gt;&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;do not change feature GUID after it's deployed and activated&lt;/LI&gt;
&lt;LI&gt;turn on auditing only if absolutely necessary&lt;/LI&gt;
&lt;LI&gt;do not use space with your list column names&lt;/LI&gt;
&lt;LI&gt;use content field control instead of content edit WebPart for publishing&lt;/LI&gt;
&lt;LI&gt;load balance your central admin site too&lt;/LI&gt;
&lt;LI&gt;avoid custom site definition if possible - use features&lt;/LI&gt;
&lt;LI&gt;use features and solutions to deploy WSS artifacts if possible&lt;/LI&gt;
&lt;LI&gt;use &lt;A href="http://www.codeplex.com/SPWCMUtils/Release/ProjectReleases.aspx?ReleaseId=5039" target=_blank mce_href="http://www.codeplex.com/SPWCMUtils/Release/ProjectReleases.aspx?ReleaseId=5039"&gt;MetaTagsGenerator&lt;/A&gt; to generate&amp;nbsp;META tag for SEO (search engine optimization)&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Application Pages Customization&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;use theme if possible and meet your needs&lt;/LI&gt;
&lt;LI&gt;do not modify the original _layout folder; make a copy of _layout folder and&amp;nbsp;change your web application point to the&amp;nbsp;_[your]layout&amp;nbsp;folder&lt;/LI&gt;
&lt;LI&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;WebPart Development&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;unless you intend to use your WebPart on SharePoint 2003 site inherit your WebPart class from &lt;FONT color=#800040&gt;System.Web.UI.WebControls.WebParts.WebPart&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;deploy WebPart dll to bin folder instead of GAC [full trust] if possible&lt;/LI&gt;
&lt;LI&gt;remember to add &lt;FONT color=#800000&gt;[assembly: AllowPartiallyTrustedCallers()]&lt;/FONT&gt; to allow the strong named assembly to run from the bin&lt;/LI&gt;
&lt;LI&gt;remember to change trust level in web.config from "WSS_Minimal" to "WSS_Medium" or create your own policy if your WebPart uses Object Model&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Using Object Model&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms778813.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/ms778813.aspx"&gt;Dispose the SPWeb and SPSite objects as soon as they are no longer needed&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;class Program&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static void Main()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string sitePath = "&lt;A href="http://litwareinc.com%22;/" mce_href='http://litwareinc.com";'&gt;http://litwareinc.com";&lt;/A&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=#008000&gt; // enter object model through site collection.&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPSite siteCollection = new SPSite(sitePath);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=#00ff00&gt; &lt;FONT color=#008000&gt;// obtain reference to top-level site.&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPWeb site = siteCollection.RootWeb; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SPWeb site1 = site; &lt;FONT color=#008000&gt;//this actually create a copy of site,&amp;nbsp;I will have followup blog on this after I find out how the assignment of an&amp;nbsp;reference type got a copy instead of a pointer&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; site1.Dispose();&amp;nbsp;&amp;nbsp;&lt;FONT color=#008080&gt; &lt;/FONT&gt;&lt;FONT color=#008000&gt;//this does not affect site&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;// enumerate through lists of site&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (SPList list in site.Lists)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(list.Title);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#00ff00&gt;&lt;FONT color=#008000&gt;// clean up by calling Dispose.&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; site.Dispose();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; siteCollection.RootWeb.Dispose();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; siteCollection.Dispose();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;Some MOSS resource links&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A title=http://www.andrewconnell.com/blog/ href="http://www.andrewconnell.com/blog/" mce_href="http://www.andrewconnell.com/blog/"&gt;http://www.andrewconnell.com/blog/&lt;/A&gt;&amp;nbsp; [instructor's blog]&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.shrinkster.com/OA6" target=_blank mce_href="http://www.shrinkster.com/OA6"&gt;Microsoft Cabinet SDK&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.shrinkster.com/O9N" target=_blank mce_href="http://www.shrinkster.com/O9N"&gt;U2U's CAML Builder 2007&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.shrinkster.com/O9O" target=_blank mce_href="http://www.shrinkster.com/O9O"&gt;Application Pool Recycler&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.shrinkster.com/O9P" target=_blank mce_href="http://www.shrinkster.com/O9P"&gt;Stramit's SharePoint CAML 2007 Viewer&lt;/A&gt;&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.shrinkster.com/O9Q" target=_blank mce_href="http://www.shrinkster.com/O9Q"&gt;Feature Explorer&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.shrinkster.com/O9R" target=_blank mce_href="http://www.shrinkster.com/O9R"&gt;SharePoint Manager 2007&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://www.shrinkster.com/O9S" target=_blank mce_href="http://www.shrinkster.com/O9S"&gt;MOSS Query Tool&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/bb417382.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/library/bb417382.aspx"&gt;How to extend STSADM.exe?&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3509998" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/johnlee/archive/tags/WSS+MOSS+2007/default.aspx">WSS MOSS 2007</category></item></channel></rss>