<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7192369654737481277</id><updated>2011-12-30T17:27:17.377-08:00</updated><title type='text'>Tim Wheeler's Blog</title><subtitle type='html'>It's late, I'm tired, stick a fork in me....</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7192369654737481277.post-8786340932650889372</id><published>2011-01-06T17:33:00.001-08:00</published><updated>2011-01-06T17:42:33.525-08:00</updated><title type='text'>Azure Cloud Storage OutOfRange Error</title><content type='html'>&lt;p&gt;I'm having an interesting time learning Azure and have found various issues, including Visual Studio 2010 hanging when the project is bound to Visual SourceSafe, random hang on project build and the AspProviders not working with development storage.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Here's what I found with the AspProviders issue:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The AspProviders from the &lt;a href="http://code.msdn.microsoft.com/windowsazuresamples"&gt;Azure Samples&lt;/a&gt; errored on start up with an OutOfRange error . The providers didn't seem to work with developer storage. The providers didn't allow access to the dev storage addresses, likely due to http instead of https. To fix this I created a helper class that would get either the developer storage or the https address.&lt;/p&gt;  &lt;p&gt;I had problems with TableStorageRoleProvider, TableStorageSessionStateProvider, TableStorageProfileProvider and TableStorageMembershipProvider.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The error I received was:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Microsoft.WindowsAzure.StorageClient.StorageClientException: Exception of type 'Microsoft.WindowsAzure.StorageClient.StorageClientException' was thrown. ---&amp;gt; System.Data.Services.Client.DataServiceQueryException: An error occurred while processing this request. ---&amp;gt; System.Data.Services.Client.DataServiceClientException: &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; standalone=&amp;quot;yes&amp;quot;?&amp;gt;&amp;lt;error xmlns=&amp;quot;http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&amp;quot;&amp;gt;&amp;lt;code&amp;gt;OutOfRangeInput&amp;lt;/code&amp;gt;&amp;lt;message xml:lang=&amp;quot;en-US&amp;quot;&amp;gt;One of the request inputs is out of range.&amp;lt;/message&amp;gt;&amp;lt;/error&amp;gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The client class I created:&lt;/strong&gt;&lt;/p&gt;      &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:8ef87bb7-ba34-474c-b07b-ef9b3fa52a61" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Code Snippet&lt;/div&gt; &lt;div style="background: #ddd; max-height: 500px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt; &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; Class to create &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;see cref=&amp;quot;CloudTableClient&amp;quot;/&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt; or &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;see cref=&amp;quot;CloudBloblClient&amp;quot;/&amp;gt;&lt;/span&gt;&lt;span style="color:#008000"&gt; or &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;see cref=&amp;quot;CloudQueueClient&amp;quot;/&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; Works with developer storage at address &amp;quot;http://127.0.0.1&amp;quot; or https address.&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#808080"&gt;///&lt;/span&gt;&lt;span style="color:#008000"&gt; &lt;/span&gt;&lt;span style="color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;StorageClient&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudTableClient&lt;/span&gt; GetCloudTableClient(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; accountName, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; sharedKey)&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; account = GetAccount(endpoint, accountName, sharedKey);&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; account.CreateCloudTableClient();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        }&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudTableClient&lt;/span&gt; GetCloudTableClient(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint, &lt;span style="color:#2b91af"&gt;StorageCredentialsAccountAndKey&lt;/span&gt; credentials)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; account = GetAccount(endpoint, credentials);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; account.CreateCloudTableClient();&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudBlobClient&lt;/span&gt; GetCloudBlobClient(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; accountName, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; sharedKey)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; account = GetAccount(endpoint, accountName, sharedKey);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; account.CreateCloudBlobClient();&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudBlobClient&lt;/span&gt; GetCloudBlobClient(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint, &lt;span style="color:#2b91af"&gt;StorageCredentialsAccountAndKey&lt;/span&gt; credentials)&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; account = GetAccount(endpoint, credentials);&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; account.CreateCloudBlobClient();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudQueueClient&lt;/span&gt; GetCloudQueueClient(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; accountName, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; sharedKey)&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; account = GetAccount(endpoint, accountName, sharedKey);&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; account.CreateCloudQueueClient();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        }&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudQueueClient&lt;/span&gt; GetCloudQueueClient(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint, &lt;span style="color:#2b91af"&gt;StorageCredentialsAccountAndKey&lt;/span&gt; credentials)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; account = GetAccount(endpoint, credentials);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; account.CreateCloudQueueClient();&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff"&gt;bool&lt;/span&gt; IsDevelopmentStorage(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;const&lt;/span&gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; devEndpoint = &lt;span style="color:#a31515"&gt;&amp;quot;http://127.0.0.1&amp;quot;&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; (endpoint != &lt;span style="color:#0000ff"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; endpoint.Length &amp;gt;= devEndpoint.Length &amp;amp;&amp;amp;&lt;/li&gt; &lt;li&gt;                    devEndpoint.ToLower().Substring(0, devEndpoint.Length) == devEndpoint);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        }&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; GetAccount(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint, &lt;span style="color:#2b91af"&gt;StorageCredentialsAccountAndKey&lt;/span&gt; credentials)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; account = &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (IsDevelopmentStorage(endpoint))&lt;/li&gt; &lt;li&gt;            {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                account = &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt;.DevelopmentStorageAccount;&lt;/li&gt; &lt;li&gt;            }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;else&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                account = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt;(credentials, &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Uri&lt;/span&gt;(endpoint));&lt;/li&gt; &lt;li&gt;            }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; account;&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; GetAccount(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; endpoint, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; accountName, &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; sharedKey)&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt; account = &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (IsDevelopmentStorage(endpoint))&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            {&lt;/li&gt; &lt;li&gt;                account = &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt;.DevelopmentStorageAccount;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            }&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;else&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            {&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; credentials = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;StorageCredentialsAccountAndKey&lt;/span&gt;(accountName, sharedKey);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                account = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CloudStorageAccount&lt;/span&gt;(credentials, &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Uri&lt;/span&gt;(endpoint));&lt;/li&gt; &lt;li&gt;            }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; account;&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;I then changed the providers where they create the cloud client.&lt;/p&gt;  &lt;p&gt;In the TableStorageRoleProvider I update the following line:&lt;/p&gt;  &lt;p&gt;_tableStorage = new CloudTableClient(baseUri, info);&lt;/p&gt;  &lt;p&gt;To:&lt;/p&gt;  &lt;p&gt;_tableStorage = StorageClient.GetCloudTableClient(baseUri, accountName, sharedKey);&lt;/p&gt;  &lt;p&gt;The other providers are similar.&lt;/p&gt;  &lt;p&gt;That’s it!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7192369654737481277-8786340932650889372?l=tjwheeler.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/8786340932650889372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tjwheeler.blogspot.com/2011/01/azure-cloud-storage-outofrange-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/8786340932650889372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/8786340932650889372'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/2011/01/azure-cloud-storage-outofrange-error.html' title='Azure Cloud Storage OutOfRange Error'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7192369654737481277.post-7268793496364543770</id><published>2010-11-24T04:34:00.001-08:00</published><updated>2010-11-24T04:34:38.682-08:00</updated><title type='text'>The Heading “Libraries” automatically added through content import</title><content type='html'>  &lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When exporting and importing a single Document Library using the Import-SPWeb command, the Heading &amp;quot;Libraries&amp;quot; is automatically added to the site navigation if it is not there. Exporting then re importing to the same site or another site always adds the heading. Seems to be no option to stop this behaviour.&lt;/p&gt;   &lt;a href="http://lh3.ggpht.com/_e2UcIpsMNgI/TO0GWMVx3_I/AAAAAAAAACk/mvIvObJspMM/s1600-h/clip_image001%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://lh5.ggpht.com/_e2UcIpsMNgI/TO0GXROi-WI/AAAAAAAAACo/NQrtj7SxPJY/clip_image001_thumb%5B1%5D.png?imgmax=800" width="546" height="103" /&gt;&lt;/a&gt;  &lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;As I don’t want the heading &lt;em&gt;Libraries&lt;/em&gt; to be added I guess I can either delete them manually or build a PowerShell script that moves through all the SPWebs and deletes them.&amp;#160; Not a great solution and this really should be controlled via parameters on Import-SPWeb.&amp;#160; Hey Microsoft, can you sort that for me please?&amp;#160; Thanks.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7192369654737481277-7268793496364543770?l=tjwheeler.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/7268793496364543770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tjwheeler.blogspot.com/2010/11/heading-libraries-automatically-added.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/7268793496364543770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/7268793496364543770'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/2010/11/heading-libraries-automatically-added.html' title='The Heading “Libraries” automatically added through content import'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_e2UcIpsMNgI/TO0GXROi-WI/AAAAAAAAACo/NQrtj7SxPJY/s72-c/clip_image001_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7192369654737481277.post-5210253042382273088</id><published>2010-11-17T04:06:00.001-08:00</published><updated>2010-11-18T05:57:27.220-08:00</updated><title type='text'>Content Migration and Taxonomy Fields</title><content type='html'>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I have been using Import-SPWeb and Export-SPWeb to migrate content from different environments and found an issue if the sites use Taxonomy Fields.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The problem in a nutshell&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The content is exported from a site using the PowerShell command Export-SPWeb or with code. The site contains Taxonomy fields included in content types. The taxonomy fields are wired to a Managed Metadata Service Term Store. The taxonomy fields have id's to both a TaxonomyHiddenList at the root web level and to the Term stores themselves. These ID's are migrated along with the list. However in the next environment you try to import the content to the Managed Metadata Service has a different ID for the Term Store, and as such the taxonomy fields fail to work properly.&lt;/p&gt;  &lt;p&gt;Note: I'm not sure if this is an issue if you use the default Managed Metadata Service, I am using a new one created from a PowerShell script.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Visible Issues &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If the site was accessed as an anonymous user, some pages would error with:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://lh4.ggpht.com/_e2UcIpsMNgI/TOPFJCLAJwI/AAAAAAAAAB4/gX5kzlWybkE/s1600-h/image%5B11%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_e2UcIpsMNgI/TOPFJ1JtnNI/AAAAAAAAAB8/eeFCa6XpJ68/image_thumb%5B5%5D.png?imgmax=800" width="317" height="144" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The error message might as well just say “Something bad’s happened, but you have to figure out what. Good luck!”&amp;#160; (Well, I could turn off custom errors but that would be too easy and harder to make fun of!)&lt;/p&gt;  &lt;p&gt;So the &lt;em&gt;Slightly&lt;/em&gt; more helpful are the trace logs which showed:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;Hidden list not found, creating new one&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;Creating taxonomy hidden list&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;Unknown SPRequest error occurred. More information: 0x80070005&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&amp;quot;System.ArgumentException: Value does not fall within the expected range.&amp;quot;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Strangely, the first page would access correctly under anonymous and subsequent requests to other pages would fail.&amp;#160; I have a theory about why but wild speculation is probably best left unsaid.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Other Symptoms&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The publishing root web contains a list called &amp;quot;TaxonomyHiddenList&amp;quot;. This list is used by the taxonomy fields to store terms in use for the site. After using Import-SPWeb many extra entries where added to this list with an empty title.&lt;/p&gt;  &lt;p&gt;If you use SharePoint Manager (very useful BTW), you will see a bunch of entries with “(no title)”.&amp;#160; As far as I can see this shouldn’t happen, normally when the taxonomy fields create these entries they include the label as the title.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_e2UcIpsMNgI/TOPWQcM9epI/AAAAAAAAACc/jL9HkPbf5qU/s1600-h/image%5B5%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_e2UcIpsMNgI/TOPWRXhAkjI/AAAAAAAAACg/CZula-qG_aQ/image_thumb%5B2%5D.png?imgmax=800" width="472" height="339" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The above screen shot of SharePoint Manager shows the bad entries.&amp;#160; Notice as well that there are lots, 64 in this example.&amp;#160; If this was working properly you should see the following:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_e2UcIpsMNgI/TOPFMhBt22I/AAAAAAAAACI/clEHk2uOIsc/s1600-h/image%5B7%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_e2UcIpsMNgI/TOPFNk1c4GI/AAAAAAAAACM/6ng510qihH4/image_thumb%5B3%5D.png?imgmax=800" width="473" height="358" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this screen shot the entries have a valid title.&amp;#160; These values originally come from the terms in the term store.&amp;#160; These entries where created by a powershell script and added to the term store, they are some of the ones required for a dublin core and AGLS metadata implementation.&amp;#160; (Which is probably about as interesting as xml namespaces or writing documentation but I felt I had to explain them anyway)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The cause&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you look at the definition of the Microsoft.SharePoint.Taxonomy.TaxonomyField you will see a property called &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.taxonomy.taxonomyfield.sspid.aspx"&gt;SspId&lt;/a&gt;. This property is the Guid of the Term Store that its connected to. After importing, this value points to the old term store. It also has a side effect of creating bad entries in the /Lists/TaxonomyHiddenList list and is likely the cause of the entries in the trace logs. The data in the field also points to the bad entry within that list rather than the entry it should point to. There is a good write up on how the entries are created &lt;a href="http://pholpar.wordpress.com/2010/02/03/some-words-about-taxonomyfieldvalue-and-its-wssid-property/"&gt;here&lt;/a&gt; so I won't go into that part too much.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The fix for this is much simpler than tracking it down I assure you. After many frustrating hours and some stern words aimed directly at SharePoint I managed to coble together a script that suitably cleans my site collections after content migration.&lt;/p&gt;  &lt;p&gt;The following is a PowerShell script that will clean up your publishing site.&amp;#160; Use at your own risk. Backup your data, etc, etc! Wish you the best of luck! Like a Microsoft error message &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://lh3.ggpht.com/_e2UcIpsMNgI/TOPH4KG7VnI/AAAAAAAAACQ/7w_zJb9cScE/wlEmoticon-smile%5B2%5D.png?imgmax=800" /&gt;&lt;/p&gt;  &lt;p&gt;Note: This script will utilise the field definitions in the root web.&amp;#160; If you are migrating an entire web then you should fix your content types prior to running this script.&lt;/p&gt;    &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:e562dd29-fec2-40a4-99ce-0e1f016e2138" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Code Snippet&lt;/div&gt; &lt;div style="background: #ddd; max-height: 500px; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 3em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#008000"&gt;#Script: CleanTaxonomyFields.ps1&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;#Author: Tim Wheeler (http://tjwheeler.blogspot.com/)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#008000"&gt;#Created: 17/11/2010&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;#Notes:&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#008000"&gt;#When content in imported into a new environment the Term Store ID is kept on the&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;#taxonomy fields.  This causes a problem as the new term store has a different id.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#008000"&gt;#These functions clean up the taxonomy list which has bad entries following an import&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;#and modify all the items and resets the correct values.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;param&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;(    &lt;/span&gt;&lt;span style="color:#800080"&gt;$siteCollectionUrl&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; (&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Read-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Please enter a site collection url&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;) )&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;#region&lt;/span&gt;&lt;span style="color:#000000"&gt; SharePoint Snappin Setup&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#800080"&gt;$snapin&lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Microsoft.SharePoint.PowerShell&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt; (&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;get-pssnapin&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$snapin&lt;/span&gt;&lt;span style="color:#000000"&gt; -ea &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;silentlycontinue&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;) {&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;write-host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-f&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;Green&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;PSsnapin $snapin is loaded&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;else&lt;/span&gt;&lt;span style="color:#000000"&gt; {&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt; (&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;get-pssnapin&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$snapin&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-registered&lt;/span&gt;&lt;span style="color:#000000"&gt; -ea &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;silentlycontinue&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;) {&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;write-host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-f&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;Green&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;PSsnapin $snapin is registered&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Add-PSSnapin&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$snapin&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;write-host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-f&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;Green&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;PSsnapin $snapin is loaded&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;else&lt;/span&gt;&lt;span style="color:#000000"&gt; {&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;write-host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-f&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;Red&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;PSSnapin $snapin not found&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;#endregion&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;#region&lt;/span&gt;&lt;span style="color:#000000"&gt; Data Clean Up&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;function&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;CleanTaxonomyList&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Cleaning /Lists/TaxonomyHiddenList&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$web&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;span style="color:#000000"&gt;.RootWeb&lt;/span&gt;&lt;/li&gt; &lt;li&gt;  &lt;span style="color:#000000"&gt;    &lt;/span&gt;&lt;span style="color:#800080"&gt;$taxlist&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$web&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetList(&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Lists/TaxonomyHiddenList&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;for&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$count&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$taxlist&lt;/span&gt;&lt;span style="color:#000000"&gt;.Items.Count &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-&lt;/span&gt;&lt;span style="color:#000000"&gt; 1; &lt;/span&gt;&lt;span style="color:#800080"&gt;$count&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-ge&lt;/span&gt;&lt;span style="color:#000000"&gt; 0; &lt;/span&gt;&lt;span style="color:#800080"&gt;$count&lt;/span&gt;&lt;span style="color:#000000"&gt;--)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;         &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$item&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$taxlist&lt;/span&gt;&lt;span style="color:#000000"&gt;.Items[&lt;/span&gt;&lt;span style="color:#800080"&gt;$count&lt;/span&gt;&lt;span style="color:#000000"&gt;]&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;([&lt;/span&gt;&lt;span style="color:#008080"&gt;string&lt;/span&gt;&lt;span style="color:#000000"&gt;]::&lt;/span&gt;&lt;span style="color:#8b4513"&gt;IsNullOrEmpty&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$item&lt;/span&gt;&lt;span style="color:#000000"&gt;.Title))&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$item&lt;/span&gt;&lt;span style="color:#000000"&gt;.Delete()&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$?&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#008000"&gt;#Write-Host &amp;quot;Deleted Item with bad title&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#008000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;else&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;Red&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Failed to deleted Item with bad title&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#008000"&gt;#This function will reset the term store id if it is wrong, and will fix the WssId.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#008000"&gt;#If the correct term cannot be located, the default one will be used.&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;function&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;ResetTaxonomyDefaults&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;span style="color:#000000"&gt;, [Microsoft.SharePoint.Publishing.PublishingWeb] &lt;/span&gt;&lt;span style="color:#800080"&gt;$web&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$txs&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;New-Object&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Microsoft.SharePoint.Taxonomy.TaxonomySession&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-ArgumentList&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;/li&gt; &lt;li&gt;   &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$pages&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$web&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetPublishingPages()&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;   &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000ff"&gt;in&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$pages&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;   &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;Cyan&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Checking publishing page &amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.Title&lt;/span&gt;&lt;/li&gt; &lt;li&gt;       &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.ListItem.File.CheckOutStatus &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-ne&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;None&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.CheckIn(&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Checked in by data clean process&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;);&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.CheckOut();&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;       &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;foreach&lt;/span&gt;&lt;span style="color:#000000"&gt; (&lt;/span&gt;&lt;span style="color:#800080"&gt;$field&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#0000ff"&gt;in&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.ListItem.Fields)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;       &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;           &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$field&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetType().Name &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-eq&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;TaxonomyField&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;           &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;               &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; [Microsoft.SharePoint.Taxonomy.TaxonomyField] &lt;/span&gt;&lt;span style="color:#800080"&gt;$field&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Found field to update:&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.Title&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$currentValue&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.ListItem.Properties[&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.InternalName]&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Current Value is&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$currentValue&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.ListItem.ParentList.ParentWeb.Site.RootWeb.Fields[&lt;/span&gt;&lt;span style="color:#800080"&gt;$field&lt;/span&gt;&lt;span style="color:#000000"&gt;.Id]&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$defaultValue&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.DefaultValue&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$termStore&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$txs&lt;/span&gt;&lt;span style="color:#000000"&gt;.TermStores[&lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.SspId]&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$termSet&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$termStore&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetTermSet(&lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.TermSetId)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.SspId &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-ne&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.SspId)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;TaxField SspId is not correct, updating&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.SspId &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.SspId&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.Update()&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.TermSetId &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-ne&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.TermSetId)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;TaxField TermSetId is not correct, updating&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.TermSetId &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.TermSetId&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.Update()&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetFieldValue(&lt;/span&gt;&lt;span style="color:#800080"&gt;$currentValue&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;  &lt;span style="color:#000000"&gt;                &lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;((&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetType().Name &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-eq&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;TaxonomyFieldValue&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;) &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-and&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-eq&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$null&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-or&lt;/span&gt;&lt;span style="color:#000000"&gt; [&lt;/span&gt;&lt;span style="color:#008080"&gt;string&lt;/span&gt;&lt;span style="color:#000000"&gt;]::&lt;/span&gt;&lt;span style="color:#8b4513"&gt;IsNullOrEmpty&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt;.TermGuid)))&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetFieldValue(&lt;/span&gt;&lt;span style="color:#800080"&gt;$defaultValue&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;  &lt;span style="color:#000000"&gt;                &lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;((&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetType().Name &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-ne&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;TaxonomyFieldValue&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;) &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-and&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt;[0] &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-eq&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$null&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-or&lt;/span&gt;&lt;span style="color:#000000"&gt; [&lt;/span&gt;&lt;span style="color:#008080"&gt;string&lt;/span&gt;&lt;span style="color:#000000"&gt;]::&lt;/span&gt;&lt;span style="color:#8b4513"&gt;IsNullOrEmpty&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt;[0].TermGuid)))&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$templateField&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetFieldValue(&lt;/span&gt;&lt;span style="color:#800080"&gt;$defaultValue&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetType().Name &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-eq&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;TaxonomyFieldValue&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$term&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$termSet&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetTerm(&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt;.TermGuid)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;catch&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;  &lt;span style="color:#000000"&gt;                        &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; -red (&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Failed to update field {0} for page {1} in web {2}&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#ff0000"&gt;-f&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.InternalName, &lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.Title, &lt;/span&gt;&lt;span style="color:#800080"&gt;$web&lt;/span&gt;&lt;span style="color:#000000"&gt;.Url)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;else&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;try&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$term&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$termSet&lt;/span&gt;&lt;span style="color:#000000"&gt;.GetTerm(&lt;/span&gt;&lt;span style="color:#800080"&gt;$fieldValue&lt;/span&gt;&lt;span style="color:#000000"&gt;[0].TermGuid)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;catch&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;  &lt;span style="color:#000000"&gt;                        &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; -red (&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Failed to update field {0} for page {1} in web {2}&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#ff0000"&gt;-f&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.InternalName, &lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.Title, &lt;/span&gt;&lt;span style="color:#800080"&gt;$web&lt;/span&gt;&lt;span style="color:#000000"&gt;.Url)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$taxField&lt;/span&gt;&lt;span style="color:#000000"&gt;.SetFieldValue(&lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.ListItem, &lt;/span&gt;&lt;span style="color:#800080"&gt;$term&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;           &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;       &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.ListItem.Update()&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;       &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$page&lt;/span&gt;&lt;span style="color:#000000"&gt;.CheckIn(&lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Data clean process&amp;quot;&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;   &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;function&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;CleanSiteCollection&lt;/span&gt;&lt;span style="color:#000000"&gt; (&lt;/span&gt;&lt;span style="color:#800080"&gt;$siteColUrl&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;[Microsoft.SharePoint.SPSite] &lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; get-spsite -Limit ALL | &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;where-object&lt;/span&gt;&lt;span style="color:#000000"&gt; {&lt;/span&gt;&lt;span style="color:#800080"&gt;$_&lt;/span&gt;&lt;span style="color:#000000"&gt;.Url &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-ieq&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$siteColUrl}&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt;(&lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;-eq&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$null&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;Red&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Unable to find site collection&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;throw&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Unable to find site collection&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;CleanTaxonomyList&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;/li&gt; &lt;li&gt;   &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;span style="color:#000000"&gt; | Get-SPWeb -limit all | &lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;ForEach-Object&lt;/span&gt;&lt;span style="color:#000000"&gt; {&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#008000"&gt;#Check to see if site is a publishing site&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#008000"&gt;    &lt;/span&gt;&lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;if&lt;/span&gt;&lt;span style="color:#000000"&gt; ([Microsoft.SharePoint.Publishing.PublishingWeb]::IsPublishingWeb(&lt;/span&gt;&lt;span style="color:#800080"&gt;$_&lt;/span&gt;&lt;span style="color:#000000"&gt;)) &lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#000000"&gt;{&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;Write-Host&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800000"&gt;&amp;quot;Cleaning pages in `&amp;quot;$($_.Title)`&amp;quot; site.&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#000000"&gt;    &lt;/span&gt;&lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#008000"&gt;#Get the Publishing Web and pages within it&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#008000"&gt;    &lt;/span&gt;&lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$publishingWeb&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#ff0000"&gt;=&lt;/span&gt;&lt;span style="color:#000000"&gt; [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb(&lt;/span&gt;&lt;span style="color:#800080"&gt;$_&lt;/span&gt;&lt;span style="color:#000000"&gt;)&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#5f9ea0"&gt;ResetTaxonomyDefaults&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$publishingWeb    &lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$_&lt;/span&gt;&lt;span style="color:#000000"&gt;.Dispose()&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#000000"&gt;&lt;/span&gt;&lt;span style="color:#800080"&gt;$site&lt;/span&gt;&lt;span style="color:#000000"&gt;.Dispose()&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#000000"&gt;}&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;#endregion&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#5f9ea0"&gt;CleanSiteCollection&lt;/span&gt;&lt;span style="color:#000000"&gt; &lt;/span&gt;&lt;span style="color:#800080"&gt;$siteCollectionUrl&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7192369654737481277-5210253042382273088?l=tjwheeler.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/5210253042382273088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tjwheeler.blogspot.com/2010/11/content-migration-and-taxonomy-fields.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/5210253042382273088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/5210253042382273088'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/2010/11/content-migration-and-taxonomy-fields.html' title='Content Migration and Taxonomy Fields'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_e2UcIpsMNgI/TOPFJ1JtnNI/AAAAAAAAAB8/eeFCa6XpJ68/s72-c/image_thumb%5B5%5D.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7192369654737481277.post-6287275209225831150</id><published>2009-11-01T19:55:00.001-08:00</published><updated>2009-11-01T19:55:15.288-08:00</updated><title type='text'>Moving Web Service Code into a GAC'd Assembly</title><content type='html'>&lt;p&gt;Don't know about you, but I can never remember the syntax of a fully qualified class.&amp;#160; Here is a quick example of taking a normal web service and splitting up the code so that it can be referenced from the GAC.&amp;#160; Often we will need to do this when the service is hosted in SharePoint.&amp;#160; &lt;/p&gt;  &lt;p&gt;Open the markup of a .asmx file.&amp;#160; Right click -&amp;gt; View Markup&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_e2UcIpsMNgI/Su5YIBc0iBI/AAAAAAAAABo/8kMp-NKoqqI/image%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="image" src="http://lh4.ggpht.com/_e2UcIpsMNgI/Su5YIodDpYI/AAAAAAAAABs/fJ1d03lLG3c/image_thumb.png" width="244" height="180" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Change it from:&lt;/p&gt; &lt;font size="2"&gt;   &lt;p&gt;&amp;lt;%&lt;/p&gt;   &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;@&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;WebService&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;Language&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;C#&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;CodeBehind&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;Service1.asmx.cs&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;Class&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;WebService1.Service1&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; %&amp;gt;&lt;/font&gt;&lt;/font&gt;  &lt;p&gt;To:&lt;/p&gt; &lt;font size="2"&gt;   &lt;p&gt;&amp;lt;%&lt;/p&gt;   &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;@&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;WebService&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;Language&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;C#&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;Class&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;MyNamespace.MyClassName, MyAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XYZ&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; %&amp;gt;&lt;/font&gt;&lt;/font&gt;  &lt;p&gt;&lt;font size="2"&gt;*There are many ways to get the public key token, easiest is probably to put the dll in the GAC then browse to %systemroot%\assembly&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;What this does&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;It allows you to put your .asmx file into a web site, such as the ISAPI folder in SharePoint, and when .Net handles the request the assembly resolver will get it out of the GAC.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Once loaded from the GAC the assembly is cached, so changes won't show up until the app pools are recycled or you run IISRESET.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Also, you will need to put the DLL into the GAC each time you compile.&amp;#160; This can be done less painfully by using a post build event or using WSPBuilder's &amp;quot;Copy to gac&amp;quot; function.&lt;/font&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7192369654737481277-6287275209225831150?l=tjwheeler.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/6287275209225831150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tjwheeler.blogspot.com/2009/11/moving-web-service-code-into-gac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/6287275209225831150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/6287275209225831150'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/2009/11/moving-web-service-code-into-gac.html' title='Moving Web Service Code into a GAC&amp;#39;d Assembly'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_e2UcIpsMNgI/Su5YIodDpYI/AAAAAAAAABs/fJ1d03lLG3c/s72-c/image_thumb.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7192369654737481277.post-2595598237954137597</id><published>2009-10-21T19:21:00.001-07:00</published><updated>2009-10-21T19:21:34.314-07:00</updated><title type='text'>SharePoint Helper Code Library (SPHelper)</title><content type='html'>&lt;p&gt;I have added my SharePoint Helper library to my new &lt;a href="http://www.purecoding.net/CodeZone/SharePoint/tabid/67/Default.aspx" target="_blank"&gt;SharePoint Code Zone&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This is a collection of utility classes in C#.&amp;#160; A lot of the code is mine, but I also want to credit &lt;a href="http://www.superedge.net/" target="_blank"&gt;Edvar Pereira (Edge)&lt;/a&gt;, Michael Van Den Berg,&amp;#160; Andrew Cox from Readify, Chris Johnson from Microsoft (I think Chris might have written some of the MSDN based code) and possibly other smart people I have worked with.&amp;#160; If anyone out there see's their code let me know and I'll credit.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7192369654737481277-2595598237954137597?l=tjwheeler.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/2595598237954137597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tjwheeler.blogspot.com/2009/10/sharepoint-helper-code-library-sphelper.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/2595598237954137597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/2595598237954137597'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/2009/10/sharepoint-helper-code-library-sphelper.html' title='SharePoint Helper Code Library (SPHelper)'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7192369654737481277.post-907813647049751929</id><published>2009-10-21T15:47:00.001-07:00</published><updated>2009-10-21T19:29:29.961-07:00</updated><title type='text'>PowerShell Execution Policy</title><content type='html'>&lt;p&gt;So I decided it was high time I looked into PowerShell and see what all the fuss was about.&amp;#160; Grabbed a script I needed from CodePlex.&amp;#160; Installed PowerShell.&amp;#160; Found the syntax to run the script:&amp;#160; .\myScript.ps1&lt;/p&gt;  &lt;p&gt;Great, so I execute it.&amp;#160; And nothing.&amp;#160; It just shows a new line with a flashing cursor.&amp;#160; Did it run? Did it error?&amp;#160; Nothing.&amp;#160; Hmm.. So I work out I can add a line to tell me the script is running:&lt;/p&gt;  &lt;p&gt;Write-Host &amp;quot;Begin&amp;quot;&lt;/p&gt;  &lt;p&gt;Cool, so I try again.&amp;#160; Nothing, nada, zip.&amp;#160; No error, no msg.&amp;#160; My script definitely isn't running or I should have seen begin.&lt;/p&gt;  &lt;p&gt;One of my colleagues, (Thanks Pete), points out that it could be the execution policy.&amp;#160; I think sure, sounds plausible, but shouldn't there be an error message telling me that the policy won't allow scripts?&amp;#160; You would think so but in this case, NO!&lt;/p&gt;  &lt;p&gt;So, I ran:&lt;/p&gt;  &lt;p&gt;get-executionpolicy&lt;/p&gt;  &lt;p&gt;it returned: Restricted.&lt;/p&gt;  &lt;p&gt;&amp;quot;Restricted&amp;quot; is the default policy on any powershell install (Or maybe its OS related, I am on Win 2003).&lt;/p&gt;  &lt;p&gt;So I ran:&lt;/p&gt;  &lt;p&gt;set-executionpolicy unrestricted&lt;/p&gt;  &lt;p&gt;and voila, I could now run my script.&lt;/p&gt;  &lt;p&gt;But I'm mad I tell you... MAD!!!!&lt;/p&gt;  &lt;p&gt;For more info about this see: &lt;a href="http://207.46.16.252/en-us/magazine/2007.09.powershell.aspx"&gt;http://207.46.16.252/en-us/magazine/2007.09.powershell.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7192369654737481277-907813647049751929?l=tjwheeler.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/907813647049751929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tjwheeler.blogspot.com/2009/10/powershell-execution-policy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/907813647049751929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/907813647049751929'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/2009/10/powershell-execution-policy.html' title='PowerShell Execution Policy'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7192369654737481277.post-3148685554295242522</id><published>2009-10-20T18:18:00.001-07:00</published><updated>2009-10-20T18:18:56.430-07:00</updated><title type='text'>Keywords not showing in Office 2003 integration</title><content type='html'>&lt;p&gt;Noticed today that the Keywords field from the content type doesn't appear in the Word integration to SharePoint 2007 SP2.&amp;#160; Didn't investigate why as we are giving up on improving the Office 03 integration.&amp;#160; Waiting for the enterprise to catch up to Office 07 or maybe skip and go straight to 2010....&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7192369654737481277-3148685554295242522?l=tjwheeler.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/3148685554295242522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tjwheeler.blogspot.com/2009/10/keywords-not-showing-in-office-2003.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/3148685554295242522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/3148685554295242522'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/2009/10/keywords-not-showing-in-office-2003.html' title='Keywords not showing in Office 2003 integration'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7192369654737481277.post-2593611336978393231</id><published>2009-10-19T21:45:00.001-07:00</published><updated>2009-10-19T22:40:48.710-07:00</updated><title type='text'>SharePoint 2007, Rich Text fields and Office 2003</title><content type='html'>&lt;p&gt;I had an interesting issue to deal with today.&amp;#160; &lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;Issue (with SharePoint 2007 Service Pack 2):&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;When using Word 2003 and saving a new document to a document library in SharePoint, a validation issue exists where it ignores input of data in a required field and continually prompts the user to enter data into that field.&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;This occurs when the field is using Rich Text, is required and the user is saving from Word 2003 (Likely other Office 2003 products have the same issue but I have not tested this).&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;strong&gt;Steps to reproduce&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;a href="http://lh4.ggpht.com/_e2UcIpsMNgI/St1M6Ullb9I/AAAAAAAAABM/fE1ohntb6Gs/1%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="1" src="http://lh4.ggpht.com/_e2UcIpsMNgI/St1M7Fqey3I/AAAAAAAAABU/jDOFdtqVVDs/1_thumb.png" width="244" height="186" /&gt;&lt;/a&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;Create a document in Word 2003, add some content.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_e2UcIpsMNgI/St1M8FzzPxI/AAAAAAAAABY/3IgvSPWiXkc/2%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="2" src="http://lh4.ggpht.com/_e2UcIpsMNgI/St1M83m_QpI/AAAAAAAAABc/9JoAD5kvKxw/2_thumb.png" width="244" height="196" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;Attempt to close the document, and save to a document library with a required Rich Text field.&amp;#160; Enter data into the Rich Text field.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;a href="http://lh4.ggpht.com/_e2UcIpsMNgI/St1M9sTYgpI/AAAAAAAAABg/vnX2lHFvMik/3%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="3" src="http://lh3.ggpht.com/_e2UcIpsMNgI/St1M90PuWCI/AAAAAAAAABk/QMX9ejX6a1Y/3_thumb.png" width="244" height="86" /&gt;&lt;/a&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;Click OK and a validation error occurs stating &amp;quot;You must specify a non-blank value for [&lt;em&gt;FIELD]&amp;quot;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;strong&gt;Cause:&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;Word accesses the SharePoint server and displays a small window allowing the user to enter data for the metadata fields.&amp;#160; It references some html and javascript on the SharePoint server which handles saving and validation.&amp;#160; The javascript file (BFORM.js) doesn't save the state of the Rich Text control, and subsequent validation calls fail.&lt;/font&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;/font&gt;    &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;strong&gt;Resolution Options:&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font size="3" face="Calibri"&gt;1.&lt;/font&gt;&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Upgrade to Office 2007&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font size="3" face="Calibri"&gt;2.&lt;/font&gt;&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Don&amp;#8217;t use Rich Text fields in the metadata schemas (Content Types)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font size="3" face="Calibri"&gt;3.&lt;/font&gt;&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Manually fix the Javascript file (Not best practice and my invalidate your warranty - but hey, what good is that anyway)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&lt;font color="#000000"&gt;&lt;span style="mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;&lt;font size="3" face="Calibri"&gt;4.&lt;/font&gt;&lt;span style="font: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3" face="Calibri"&gt;Raise the issue to Microsoft Support (and wait 2 months)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;strong&gt;Javascript Fix Option&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;If you choose to fix the javascript here is what you need to do:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;Locate the file at: &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;*Note: The folder 1033 may be different depending on your language.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;strong&gt;Edit this file and do the following:&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;1.&amp;#160; Add a global variable &amp;quot;var custom_ActiveForm;&amp;quot; some where towards the top of the file.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;2.&amp;#160; Search for the function &amp;quot;function OWSForm&amp;quot; and &lt;/font&gt;    &lt;p&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;add the following line to the top of that function:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#000000" size="3" face="Calibri"&gt;&lt;font size="2"&gt;&lt;/font&gt;      &lt;p&gt;custom_ActiveFormName = stName; &lt;/p&gt;     &lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//Customisation to fix issue with Word 2003&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p style="margin: 0cm 0cm 0pt" class="MsoNormal"&gt;&lt;/p&gt;  &lt;p&gt;3. Search for the function &amp;quot;function RTE_SaveSelection&amp;quot; and a&lt;font color="#000000"&gt;&lt;font size="3" face="Calibri"&gt;dd the following to the end of this function:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;try    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; document.forms[custom_ActiveFormName][strBaseElementID].innerText = docEditor.activeElement.innerHTML;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } catch (e) { }&lt;/p&gt;  &lt;p style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt; mso-list: l0 level1 lfo1" class="MsoListParagraph"&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What this does:&lt;/p&gt;  &lt;p&gt;It makes the Html Editor save the data into the appropriate form property.&amp;#160; &lt;/p&gt;  &lt;p&gt;*Please note:&amp;#160; I generally don't recommend this option as I cannot be sure it doesn't impact any other areas of SharePoint.&amp;#160; Use at your own risk.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7192369654737481277-2593611336978393231?l=tjwheeler.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tjwheeler.blogspot.com/feeds/2593611336978393231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://tjwheeler.blogspot.com/2009/10/sharepoint-2007-rich-text-fields-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/2593611336978393231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7192369654737481277/posts/default/2593611336978393231'/><link rel='alternate' type='text/html' href='http://tjwheeler.blogspot.com/2009/10/sharepoint-2007-rich-text-fields-and.html' title='SharePoint 2007, Rich Text fields and Office 2003'/><author><name>Tim Wheeler</name><uri>http://www.blogger.com/profile/11837450194858276673</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_e2UcIpsMNgI/St1M7Fqey3I/AAAAAAAAABU/jDOFdtqVVDs/s72-c/1_thumb.png' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
