<?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-692351590921880292</id><updated>2011-11-27T15:16:35.882-08:00</updated><title type='text'>Althoff's Point</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://althoffspoint.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://althoffspoint.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Nick</name><uri>http://www.blogger.com/profile/09214691417258131497</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>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-692351590921880292.post-7013013890066867232</id><published>2009-05-17T13:11:00.000-07:00</published><updated>2009-05-17T13:14:05.767-07:00</updated><title type='text'>Presenting at Chicago SharePoint Saturday!</title><content type='html'>I've been selected as a speaker at Chicago SharePoint Saturday!&lt;div&gt;http://www.sharepointsaturday.org/chicago/meetings/8/200LevelCustomUserProfileImportandSearch.aspx&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;For all of those interested, here is the link to the event:&lt;/div&gt;&lt;div&gt;http://www.sharepointsaturday.org/chicago/default.aspx&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'll be doing a presentation about custom active directory Import into the SharePoint user profile. &lt;/div&gt;&lt;div&gt;Wish me luck!&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/692351590921880292-7013013890066867232?l=althoffspoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://althoffspoint.blogspot.com/feeds/7013013890066867232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://althoffspoint.blogspot.com/2009/05/presenting-at-chicago-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/7013013890066867232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/7013013890066867232'/><link rel='alternate' type='text/html' href='http://althoffspoint.blogspot.com/2009/05/presenting-at-chicago-sharepoint.html' title='Presenting at Chicago SharePoint Saturday!'/><author><name>Nick</name><uri>http://www.blogger.com/profile/09214691417258131497</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-692351590921880292.post-6176451667463644686</id><published>2009-03-26T12:17:00.000-07:00</published><updated>2009-03-26T12:46:41.238-07:00</updated><title type='text'>Removing a workflow from deleted items</title><content type='html'>&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;A client of mine has a SharePoint task list that has a SharePoint Designer workflow attached to it. The workflow was a basic notification workflow. When an item is added to the list, the workflow kicks off and sends reminder emails to the assigned person 30, 15, 10,7,3 and 1 days before the task is due if it’s not completed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;It’s a straight forward workflow modeled off of the Notification workflow that comes with the Employee Training site template provided by Microsoft.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.0pt; font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;The Problem:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;When items are deleted from the list, the workflows are not cancelled. People were still getting emails for items that were deleted!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;An easy fix for this is to attach a simple event handler to the list and on the “OnDeleting” event, remove all workflows from the item. This will works for all items moving forward, but it doesn’t stop the workflows that have already been started. In this case there were many items that had been deleted with running workflows.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;What I wanted to do was to go through the recycle bin and delete all of the workflows from all items that came from that list. &lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;I figured this would be easy enough, but it turns out I was mistaken. There is no way to get an instance of a workflow to kill it without having the ID of the item it was attached to, and you can’t get the ID of an item that resides in the recycling bin.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.0pt; font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Solution:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Let me start by saying I think that this solution is “hackish” at best. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Here are the steps I took&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" style="margin-bottom:0in;margin-bottom:.0001pt; mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: Georgia;mso-bidi-font-family:Georgia;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;1.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Using an SPQuery object, Take a snap shot of the current list (Before)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin-bottom:0in;margin-bottom: .0001pt;mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: Georgia;mso-bidi-font-family:Georgia;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;2.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Restore all of the items out of the recycle bin that came from the list&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin-bottom:0in;margin-bottom: .0001pt;mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: Georgia;mso-bidi-font-family:Georgia;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;3.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Using an SPQuery object, take another snap shot of the list after restoring all items (After)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin-bottom:0in;margin-bottom: .0001pt;mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: Georgia;mso-bidi-font-family:Georgia;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;4.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Check each item in the “after” list and see if it resides in the “before” list&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin-bottom:0in;margin-bottom: .0001pt;mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: Georgia;mso-bidi-font-family:Georgia;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;5.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;If it does not exist&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin-top:0in;margin-right:0in; margin-bottom:0in;margin-left:1.0in;margin-bottom:.0001pt;mso-add-space:auto; text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo1"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: Georgia;mso-bidi-font-family:Georgia;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;a.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;The item was a restored item&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin-top:0in;margin-right:0in; margin-bottom:0in;margin-left:1.0in;margin-bottom:.0001pt;mso-add-space:auto; text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo1"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: Georgia;mso-bidi-font-family:Georgia;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;b.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Get all workflows for this restored item and delete all associated workflows&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="margin-top:0in;margin-right:0in; margin-bottom:0in;margin-left:1.0in;margin-bottom:.0001pt;mso-add-space:auto; text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo1"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: Georgia;mso-bidi-font-family:Georgia;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;c.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Send the item back to the recycle bin&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;That’s it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;The code is posted below. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Hope this helps someone else!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span class="Apple-style-span" style="font-size: 13px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;static void Main(string[] args)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            WriteToLogFile(" ****** Starting on:" + DateTime.Now.ToString() + " ****** ");&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            try&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                using (SPSite site = new SPSite(ConfigurationManager.AppSettings["SITE_URL"]))&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                    using (SPWeb web = site.OpenWeb())&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                    {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        WriteToLogFile("Opened Web:" + web.Url);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        SPList list = web.Lists[ConfigurationManager.AppSettings["LIST_NAME"]];&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        string url = list.DefaultViewUrl.Substring(0, list.DefaultViewUrl.LastIndexOf("/"));&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        url = url.Substring(1);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        WriteToLogFile("Got List:" + url);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        &lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        SPListItemCollection before = GetListItems(list);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        WriteToLogFile("Count before:" + before.Count.ToString());&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        before.GetDataTable().WriteXml("Before.xml");&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        &lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        SPRecycleBinItemCollection bin = web.RecycleBin;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        WriteToLogFile("Url:" + url);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        for (int i = bin.Count - 1; i &gt;= 0; i--)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            WriteToLogFile("DirName:" + bin[i].DirName);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            if (url == bin[i].DirName)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                WriteToLogFile("Restoring:" + bin[i].Title);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                bin[i].Restore();&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            else&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                WriteToLogFile("Not restoring:" + bin[i].Title);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        SPListItemCollection after = GetListItems(list);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        &lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        WriteToLogFile("Count after:" + after.Count.ToString());&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        after.GetDataTable().WriteXml("After.xml");&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        if (before.Count == after.Count)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            WriteToLogFile("Before and After counts match. No work to be done!");&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            return;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        WriteToLogFile("Before and After do not match. Digging through after list to see which items have been restored");&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        for (int i = after.Count-1; i &gt;= 0; i--)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            SPListItem itemBefore = null;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            try&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                itemBefore = before.GetItemById(after[i].ID);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                WriteToLogFile("Item found. Not Deleting item ID:" + itemBefore.ID.ToString() + " - " +  itemBefore.Title);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            catch&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            {}&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            //Item Not Found before, remove workflows and delete it.&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            if (itemBefore == null)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                WriteToLogFile("Restored item found. ID:" + after[i].ID.ToString() + " - " + after[i].Title);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                RemoveWorkflowsFromItem(after[i]);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                WriteToLogFile("Sending Item ID:"+after[i].ID.ToString()+" to Recycle bin");&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                                after[i].Recycle();&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                            }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                        }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                    }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            catch (Exception ex)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                WriteToLogFile(ex.ToString());&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            &lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            WriteToLogFile(" ****** Complete on:" + DateTime.Now.ToString() + " ****** ");&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            &lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        private static void RemoveWorkflowsFromItem(SPListItem item)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            SPWorkflowManager mgr = item.ParentList.ParentWeb.Site.WorkflowManager;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            SPWorkflowCollection coll = mgr.GetItemWorkflows(item);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            if (coll.Count &gt; 0)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                WriteToLogFile("Removing " + coll.Count.ToString() + " workflows for:" + item.Title);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                for (int w = coll.Count - 1; w &gt;= 0; w--)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                    mgr.RemoveWorkflowFromListItem(coll[w]);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            else&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;                WriteToLogFile("No workflows to remove from " + item.Title);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        private static SPListItemCollection GetListItems(SPList tasks)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            SPQuery query = new SPQuery();&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            query.Query = "&lt;where&gt;&lt;gt&gt;&lt;fieldref name="'ID'"&gt;&lt;value type="'Counter'"&gt;0&lt;/value&gt;&lt;/gt&gt;&lt;/where&gt;&lt;orderby&gt;&lt;fieldref name="'ID'" ascending="'False'"&gt;&lt;/orderby&gt;";&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            return tasks.GetItems(query);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        private static void WriteToLogFile(string message)&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        {&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            System.IO.StreamWriter sw = new System.IO.StreamWriter("Workflowcleaner.txt",true);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            sw.WriteLine(message);&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;            sw.Close();&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;        }&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;    }&lt;/p&gt;&lt;p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/692351590921880292-6176451667463644686?l=althoffspoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://althoffspoint.blogspot.com/feeds/6176451667463644686/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://althoffspoint.blogspot.com/2009/03/removing-workflow-from-deleted-items.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/6176451667463644686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/6176451667463644686'/><link rel='alternate' type='text/html' href='http://althoffspoint.blogspot.com/2009/03/removing-workflow-from-deleted-items.html' title='Removing a workflow from deleted items'/><author><name>Nick</name><uri>http://www.blogger.com/profile/09214691417258131497</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-692351590921880292.post-2405015429213047761</id><published>2009-02-02T13:42:00.000-08:00</published><updated>2009-02-02T13:44:05.549-08:00</updated><title type='text'>SPDisposeCheck Released!</title><content type='html'>&lt;div&gt;I've seen posts about this in the past and its finally released. I'm going to start using this on the code I develop as this can be a tricky thing to master, especially at first.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://blogs.msdn.com/sharepoint/archive/2009/01/29/spdisposecheck-released.aspx"&gt;http://blogs.msdn.com/sharepoint/archive/2009/01/29/spdisposecheck-released.aspx&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/692351590921880292-2405015429213047761?l=althoffspoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://althoffspoint.blogspot.com/feeds/2405015429213047761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://althoffspoint.blogspot.com/2009/02/spdisposecheck-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/2405015429213047761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/2405015429213047761'/><link rel='alternate' type='text/html' href='http://althoffspoint.blogspot.com/2009/02/spdisposecheck-released.html' title='SPDisposeCheck Released!'/><author><name>Nick</name><uri>http://www.blogger.com/profile/09214691417258131497</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-692351590921880292.post-3359936986603534524</id><published>2009-01-28T11:14:00.000-08:00</published><updated>2009-01-28T11:21:04.202-08:00</updated><title type='text'>STSADM - "Command line error"</title><content type='html'>&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-family: Georgia, serif; color: black; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;I got this question from a client and its one I've wrestled with before. The solution is quite embarrassing, but not always easy to uncover.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-family: Georgia, serif; color: black; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;The issue in question was this: &lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-family: Georgia, serif; color: black; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt; The SharePoint admin was trying to do a backup of the current SharePoint site. I had left instructions on how to do this before I left so he just copied/pasted my instructions into the command line. After hitting “enter “he got the lovely "&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Command Line Error&lt;/span&gt;" message. He said he spend the whole morning trying to figure out what the issue was.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-family: Georgia, serif; color: black; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;What was the Solution?&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-family: Georgia, serif; color: black; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Microsoft word had modified the dashes in the command to the double dash thing. I told him to simply type it all out instead of pasting in the command.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-family: Georgia, serif; color: black; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Success!!&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-family: Georgia, serif; color: black; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Embarrassing no?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;&lt;span style="font-family: Georgia, serif; color: black; "&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;So if you are having a command line error and you are pasting in the command, try to type out the command by hand. &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal"&gt;Enjoy!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/692351590921880292-3359936986603534524?l=althoffspoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://althoffspoint.blogspot.com/feeds/3359936986603534524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://althoffspoint.blogspot.com/2009/01/stsadm-command-line-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/3359936986603534524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/3359936986603534524'/><link rel='alternate' type='text/html' href='http://althoffspoint.blogspot.com/2009/01/stsadm-command-line-error.html' title='STSADM - &quot;Command line error&quot;'/><author><name>Nick</name><uri>http://www.blogger.com/profile/09214691417258131497</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-692351590921880292.post-7251461656464984882</id><published>2009-01-14T14:07:00.000-08:00</published><updated>2009-01-14T14:25:51.762-08:00</updated><title type='text'>Exposing InfoPath Forms via URL</title><content type='html'>At my current client, we published various InfoPath forms to Forms Libraries. We needed a way to expose the forms as links throughout the site. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;At first I figured this would be easy, but it turns out it is not.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;I tried this first:&lt;/div&gt;&lt;div&gt;http://[server]/[site]/[list]/Forms/Template.xsn.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Perfect! Except that this does not work in FireFox. Turns out that even with a link directly to the file, SharePoint runs some javascript behind the scenes to see how the file should be displayed. It attempts to create an ActiveX Object, which fails in Firefox. The function is written poorly as when the ActiveX create fails, it attempts to open the form using Form Services. &lt;/div&gt;&lt;div&gt;Our form was not Form Services compatible so we were getting errors when Form Services tried to expose the form.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Long story short, it didn't work.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;I began digging and found other posts that simply paste the JavaScript that SharePoint uses into a Content editor web part. Unfortunately that wasn't going to work for me as our client utilizes links lists and needed a way to expose them via a URL.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That didn't work either.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After digging around in the javascript files a little more I decided to take a new route. &lt;/div&gt;&lt;div&gt;I installed and monitored the network traffic with &lt;a href="http://www.fiddlertool.com/fiddler/"&gt;Fiddler&lt;/a&gt;. I found that SharePoint actually changes pages a few times before the forms are exposed. I tried the different links it was navigating to until one worked.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the solution!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;https://[server]/[site]/[list]/forms/template.xsn?OpenIn=PreferClient&amp;amp;NoRedirect=true&amp;amp;XsnLocation=/[site]/[List]/forms/template.xsn&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope this saves someone else some headache!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/692351590921880292-7251461656464984882?l=althoffspoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://althoffspoint.blogspot.com/feeds/7251461656464984882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://althoffspoint.blogspot.com/2009/01/exposing-infopath-forms-via-url.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/7251461656464984882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/7251461656464984882'/><link rel='alternate' type='text/html' href='http://althoffspoint.blogspot.com/2009/01/exposing-infopath-forms-via-url.html' title='Exposing InfoPath Forms via URL'/><author><name>Nick</name><uri>http://www.blogger.com/profile/09214691417258131497</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-692351590921880292.post-2315734953625586228</id><published>2009-01-12T14:38:00.001-08:00</published><updated>2009-01-12T14:59:14.554-08:00</updated><title type='text'>CQWP and RSS Feeds</title><content type='html'>&lt;span xmlns=""&gt;&lt;span style="font-family:Georgia;"&gt;I decided to do a SharePoint blog, so here goes!&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;At my current client, we have a well defined Content Type structure. On the home page of their intranet they have CQWP's that roll up announcements, alerts etc from all over the site.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;They needed a way for users to subscribe to the alerts. Since they were rolling up the content, having the users go to each list and subscribe to alerts was not going to work.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;Since we were using CQWP's I decided to enable the RSS feed functionality of the CQWP. In the presentation section of the web part I checked the "Enable feed for this web part" and gave it a name. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;&lt;a href="http://lh6.ggpht.com/_a9hdAC9aCfY/SWvAqyPHMYI/AAAAAAAACpQ/atWB6YmrNQs/EnableFeed.jpg"&gt;&lt;img style="WIDTH: 230px; CURSOR: hand; HEIGHT: 127px" alt="" src="http://lh6.ggpht.com/_a9hdAC9aCfY/SWvAqyPHMYI/AAAAAAAACpQ/atWB6YmrNQs/EnableFeed.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;&lt;br /&gt;I saved the web part and now a new shiny RSS icon appeared at the bottom of the web part:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;a href="http://lh5.ggpht.com/_a9hdAC9aCfY/SWvBc5Iq6KI/AAAAAAAACpY/rgGXHdBm9BM/FeedVisible.jpg"&gt;&lt;img style="WIDTH: 347px; CURSOR: hand; HEIGHT: 79px" alt="" src="http://lh5.ggpht.com/_a9hdAC9aCfY/SWvBc5Iq6KI/AAAAAAAACpY/rgGXHdBm9BM/FeedVisible.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;Easy enough right? Not so fast.&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;I clicked on the RSS feed icon and got an ugly SharePoint error.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Georgia;"&gt;&lt;span style="color:black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;&lt;span style="color:black;"&gt;"Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). at System.Guid..ctor(String g) at Microsoft.SharePoint.Publishing.Internal.CodeBehind.FeedPage.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) "&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;I did some research into this and I saw a few people with the error, but no one with any cut and dry solution. I continued to try a few things and came across the solution (for me at least)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;In my current implementation, we have the publishing Infrastructure Site collection features turned on, but not the Office SharePoint Server Publishing features at the site level. Therefore my CQWP was on the default page (&lt;a href="http://server/default.aspx"&gt;&lt;span style="TEXT-DECORATION: underline;color:blue;" &gt;http://server/default.aspx&lt;/span&gt;&lt;/a&gt;). By adding a pages library called "Pages", adding a page to it and dropping my CQWP onto that page, the RSS feed works!&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;Turns out the CQWP is assuming it's situated on a web part page in a "Pages" page library.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;So as a workaround, created a small Content Editor web part that sits below the CQWP on the default page, and linked to the RSS feed page of the identical CQWP that resides on the Web Part page that is in the pages library... &lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:Georgia;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;span xmlns=""&gt;&lt;span style="font-family:Georgia;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span xmlns=""&gt;&lt;span style="font-family:Georgia;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span xmlns=""&gt;&lt;span style="font-family:Georgia;"&gt;&lt;a href="http://lh3.ggpht.com/_a9hdAC9aCfY/SWvEqh7FOeI/AAAAAAAACpo/zubMykzsLcg/RSSFinal.jpg"&gt;&lt;img style="WIDTH: 766px; CURSOR: hand; HEIGHT: 250px" alt="" src="http://lh3.ggpht.com/_a9hdAC9aCfY/SWvEqh7FOeI/AAAAAAAACpo/zubMykzsLcg/RSSFinal.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Georgia;"&gt;Works like a charm!&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:Georgia;"&gt;Enjoy!!&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:Georgia;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="font-family:Georgia;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="font-family:Georgia;"&gt;Hopefully there will be many more to come! &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/692351590921880292-2315734953625586228?l=althoffspoint.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://althoffspoint.blogspot.com/feeds/2315734953625586228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://althoffspoint.blogspot.com/2009/01/cqwp-and-rss-feeds.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/2315734953625586228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/692351590921880292/posts/default/2315734953625586228'/><link rel='alternate' type='text/html' href='http://althoffspoint.blogspot.com/2009/01/cqwp-and-rss-feeds.html' title='CQWP and RSS Feeds'/><author><name>Nick</name><uri>http://www.blogger.com/profile/09214691417258131497</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://lh6.ggpht.com/_a9hdAC9aCfY/SWvAqyPHMYI/AAAAAAAACpQ/atWB6YmrNQs/s72-c/EnableFeed.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
