<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0"><channel><title>SharePoint adventures</title><link>http://blogs.msdn.com/b/andrasg/</link><description>A blog about random SharePoint stuff</description><dc:language>en-US</dc:language><generator>Telligent Community 5.6.583.21163 (Build: 5.6.583.21163)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/SharepointAdventures" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="sharepointadventures" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Content deployment fails with guid conflict</title><link>http://blogs.msdn.com/b/andrasg/archive/2012/02/16/content-deployment-fails-with-guid-conflict.aspx</link><pubDate>Thu, 16 Feb 2012 13:57:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10268603</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10268603</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2012/02/16/content-deployment-fails-with-guid-conflict.aspx#comments</comments><description>&lt;p&gt;When setting up content deployment, you might need to start from scratch on the destination side. You delete the sitecollection, create a new one and try running the deployment. The deployment process will fail and log an error that states that the database already contains an item with the same guid.&lt;/p&gt;  &lt;p&gt;The reason for this behaviour lies in the way SP2010 works post SP1. The feature is called sitecollection recycle bin. Sitecollections when deleted from the GUI or powershell are marked as deleted but are kept in the DB.&lt;/p&gt;  &lt;p&gt;You can see which sitecollections have been deleted by running the Get-SPDeletedSite powershell cmdlet.&lt;/p&gt;  &lt;p&gt;To delete these sites from the DB, you need to remove them using the Remove-SPDeletedSite cmdlet. After you have run this, you will need to manually start the Gradual site delete job that will actually delete the content from the DB.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10268603" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=PGtfw0FoJG4:GwKtCTEJL40:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/PGtfw0FoJG4" height="1" width="1"/&gt;</description></item><item><title>Content deployment job stuck on preparing</title><link>http://blogs.msdn.com/b/andrasg/archive/2012/02/14/content-deployment-job-stuck-on-preparing.aspx</link><pubDate>Tue, 14 Feb 2012 20:35:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10267882</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10267882</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2012/02/14/content-deployment-job-stuck-on-preparing.aspx#comments</comments><description>&lt;p&gt;After you have successfully verified your content deployment job on a newly created farm, and your deployment jobs are stuck on the status Preparing and you see the message Content deployment status not available in the ULS log, just go back to Content deployment settings on Central Admin, make sure something is selected in the export server dropdown and click Ok. Even if you haven’t changed anything. Voliá, content deployment jobs start running.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10267882" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=G3Mx0oMXA4U:rpDoq12uAX8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/G3Mx0oMXA4U" height="1" width="1"/&gt;</description></item><item><title>SharePoint 2010 Master</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/10/17/sharepoint-2010-master.aspx</link><pubDate>Mon, 17 Oct 2011 18:54:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10226595</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10226595</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/10/17/sharepoint-2010-master.aspx#comments</comments><description>&lt;p&gt;Recently I had the opportunity to take part in the the 9th rotation of the SharePoint 2010 Master course in Redmond. I had big expectations on the course itself, having heard a lot of good things about it. Among the good things every single master I have talked to pointed out the very demanding and challenging nature of the course.&lt;/p&gt;  &lt;p&gt;Well, I can definitely say that it has been the most intense three weeks of my technical life. Not only was the content very well built and wide-spread, but the pace of the training was also very fast. Listening to the introductions on the first day I immediately noticed that my fellow master candidates are all very experienced and quite knowledgeable on SharePoint. People attending the course had a very good general knowledge but also contributed with unique areas of expertise that came in very handy later during team exercises.&lt;/p&gt;  &lt;p&gt;Time management played a critical role throughout the duration of the master rotation. Starting from the first day, the candidates had to have a perfect knowledge on how much they can handle, what are their strengths and weaknesses, and how to process an awful lot of information while keeping a healthy balance between learning and relaxation. When you are surrounded with a technical topic for more than 10 days for 12+ hours a day, it is critical to find a way to maintain your concentration and keep some reserves for the qualification lab and knowledge exam.&lt;/p&gt;  &lt;p&gt;Speaking of exams, both the qual lab and the knowledge exams were very demanding. And again, time management, time management, time management… &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-28-85-metablogapi/4760.wlEmoticon_2D00_smile_5F00_6455C7E0.png" /&gt;&lt;/p&gt;  &lt;p&gt;Summing it all up, I think it was a well invested effort, I met my calculation and not only learned a lot on SharePoint 2010 and myself, but also met a lot of very bright, fun people!&lt;/p&gt;  &lt;p&gt;Oh yes, I almost forgot. I am now certified as a SharePoint 2010 Master! &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-openmouthedsmile" alt="Open-mouthed smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-28-85-metablogapi/4505.wlEmoticon_2D00_openmouthedsmile_5F00_6DCE8656.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10226595" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=N1CvYKLp-80:cEwutGwk6pI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/N1CvYKLp-80" height="1" width="1"/&gt;</description></item><item><title>Deciphering the encoded claims string</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/08/23/deciphering-the-encoded-claims-string.aspx</link><pubDate>Tue, 23 Aug 2011 10:17:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10198937</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10198937</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/08/23/deciphering-the-encoded-claims-string.aspx#comments</comments><description>&lt;p&gt;During a recent claims discussion, it came up how SharePoint 2010 encodes claims into encoded claim strings.&lt;/p&gt;  &lt;p&gt;Here’s the answer:&lt;/p&gt;  &lt;p&gt;The claim i:0#.w|europe\andrasg translates into:&lt;/p&gt;  &lt;p&gt;i: This is an identity claim. Other claims would have the character c here.&lt;/p&gt;  &lt;p&gt;:: Colon separator&lt;/p&gt;  &lt;p&gt;0: Reserved for later use&lt;/p&gt;  &lt;p&gt;#: Claim type = SPClaimTypes.UserLogonName&lt;/p&gt;  &lt;p&gt;.: Claim value type = Microsoft.IdentityModel.Claims.ClaimValueTypes.String&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can find the full list of values at:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/gg481769.aspx" href="http://msdn.microsoft.com/en-us/library/gg481769.aspx"&gt;http://msdn.microsoft.com/en-us/library/gg481769.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;These unified encoding values ensure that different farms can understand each others claims. Be aware though that if you use a custom claim type, the encoded string can differ from farm to farm.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10198937" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=XvOHPJsybdA:EvQNF3jcHRk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/XvOHPJsybdA" height="1" width="1"/&gt;</description></item><item><title>Description goes missing on editforms</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/07/27/description-goes-missing-on-editforms.aspx</link><pubDate>Wed, 27 Jul 2011 21:01:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10190500</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10190500</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/07/27/description-goes-missing-on-editforms.aspx#comments</comments><description>&lt;p&gt;I had some trouble today finding the reason why descriptions set on fields did not show up on the editform. Turned out that &lt;a href="http://officetoolbox.codeplex.com/" target="_blank"&gt;Office Toolbox&lt;/a&gt; was installed and even though it was not active, made all descriptions disappear.&lt;/p&gt;  &lt;p&gt;Retracting the OfficeToolbox wsp solved the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10190500" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=eAELMoIatV0:0SdspC96bt0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/eAELMoIatV0" height="1" width="1"/&gt;</description></item><item><title>Beware of conflicting field static names</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/07/27/beware-of-conflicting-field-static-names.aspx</link><pubDate>Wed, 27 Jul 2011 20:59:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10190499</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10190499</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/07/27/beware-of-conflicting-field-static-names.aspx#comments</comments><description>&lt;p&gt;Recently I came across a problem where pushdown of changes on a contenttype did not work when doing a feature upgrade. The appropriate AddContentTypeField command was specified in the feature.xml template:&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;AddContentTypeField ContentTypeId=&amp;quot;averylongidhere&amp;quot;      &lt;br /&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;FieldId=&amp;quot;{133865E2-17C6-4c42-B98A-D4D09BA43714}&amp;quot; PushDown=&amp;quot;TRUE&amp;quot;/&amp;gt;     &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Digging deeper I found no errors when upgrading the feature so I was about to give up when I tried to manually add the field to the contenttype from the UI. I was greeted with a nice exception when clicking “Add from existing site columns”. This error showed up in the ULS log with a trace and callstack. The error message was rather misleading, telling that there is a column that has multiple choice values with the same ID.&lt;/p&gt;  &lt;p&gt;Examining my solution I found a few fields that had a StaticName that already existed. This resulted in site columns with the same staticname but a different ID. Cleaning these up made the error disappear.&lt;/p&gt;  &lt;p&gt;It’s been a happy SharePoint day. &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-28-85-metablogapi/1732.wlEmoticon_2D00_smile_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10190499" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=lipu0ltazWE:nEJXP63q2pE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/lipu0ltazWE" height="1" width="1"/&gt;</description></item><item><title>The good solution for versioning SharePoint 2010 webparts</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/07/19/the-good-solution-for-versioning-sharepoint-2010-webparts.aspx</link><pubDate>Tue, 19 Jul 2011 01:26:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10187715</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10187715</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/07/19/the-good-solution-for-versioning-sharepoint-2010-webparts.aspx#comments</comments><description>&lt;p&gt;Everyone who has had the pleasure of working in a team with other developers and using TFS with auto-incrementing version numbers most probably have faced the issue with webparts breaking after an increment in version numbers. This effect is not at all strange, as SharePoint keep the full signature of the class behind the webpart and as this changed it will not know how to render the webpart.&lt;/p&gt;  &lt;p&gt;To solve this problem, a very easy workaround is to create a class in a separate assembly that inherits from the version-controlled webpart .cs file and implements the actual webpart. This way the non-version controlled part of the code is very thin and SharePoint is still happy with it. Problem of this solution is that it requires and additional assembly file and also generates quite some overhead (SPWebConfigModification class) when packaging your solution.&lt;/p&gt;  &lt;p&gt;Come SharePoint 2010, a lot nicer solution is available:&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;Assemblies&amp;gt;     &lt;br /&gt;&amp;#160; &amp;lt;Assembly Location=&amp;quot;assemblyname.dll&amp;quot; DeploymentTarget=&amp;quot;GlobalAssemblyCache&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;BindingRedirects&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;BindingRedirect OldVersion=&amp;quot;0.0.0.0-1.0.0.0&amp;quot; NewVersion=&amp;quot;2.0.0.0&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/BindingRedirects&amp;gt;      &lt;br /&gt;&amp;#160; &amp;lt;/Assembly&amp;gt;      &lt;br /&gt;&amp;lt;/Assemblies&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;You could even omit the NewVersion tag and have a wide OldVersion range.&lt;/p&gt;  &lt;p&gt;One thing to be careful of is keeping old SafeControl entries. If you remove them, assembly redirection will not work as the original assembly will not be loaded. This results in SharePoint also not updating its references to the old assembly version. Also keep in mind that SharePoint updates assembly references page-by-page when they webparts on the page are loaded, so all pages need to be “touched” in order to get rid of old references.&lt;/p&gt;  &lt;p&gt;To get around the bug with leading zeros in the public key token’s bytes make sure you are at least on the June 2011 CU.&lt;/p&gt;  &lt;p&gt;More info on the issue:   &lt;br /&gt;&lt;a title="http://www.bluedoglimited.com/SharePointThoughts/Lists/Posts/Post.aspx?ID=313" href="http://www.bluedoglimited.com/SharePointThoughts/Lists/Posts/Post.aspx?ID=313"&gt;http://www.bluedoglimited.com/SharePointThoughts/Lists/Posts/Post.aspx?ID=313&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And the resolution:   &lt;br /&gt;&lt;a title="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/07/18/assembly-binding-redirection-bug-fixed-in-june-cu.aspx" href="http://blogs.msdn.com/b/mcsnoiwb/archive/2011/07/18/assembly-binding-redirection-bug-fixed-in-june-cu.aspx"&gt;http://blogs.msdn.com/b/mcsnoiwb/archive/2011/07/18/assembly-binding-redirection-bug-fixed-in-june-cu.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10187715" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=XXoM5T8jFj8:g1nVGbN1ysA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/XXoM5T8jFj8" height="1" width="1"/&gt;</description></item><item><title>DataFormWebPart XSL variables are emtpy</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/07/06/dataformwebpart-xsl-variables-are-emtpy.aspx</link><pubDate>Wed, 06 Jul 2011 22:18:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10183784</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10183784</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/07/06/dataformwebpart-xsl-variables-are-emtpy.aspx#comments</comments><description>&lt;p&gt;If you discover that a DataFormWebPart added programmatically is missing values in its built in XSL variables, like HttpVDir or PageUrl, verify that the ViewFlag attribute is set to something other than zero on your webpart. Took me some time to find out… Also, would be nice to know what this property stands for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10183784" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=0xiHRMdN2eQ:tEFrguW5Qoo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/0xiHRMdN2eQ" height="1" width="1"/&gt;</description></item><item><title>What to do when SPContext is null but you need it?</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/06/27/what-to-do-when-spcontext-is-null-but-you-need-it.aspx</link><pubDate>Mon, 27 Jun 2011 15:01:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10179454</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10179454</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/06/27/what-to-do-when-spcontext-is-null-but-you-need-it.aspx#comments</comments><description>&lt;p&gt;Sometimes you stumble upon really strange errors when doing trivial things. When you dig deeper, sometimes it turns out the error comes from the lack of a HttpContext, for example when running some action through STSADM or a timer job.&lt;/p&gt;  &lt;p&gt;Recently I faced a strange ArgumentNullException when creating a Content by Query Webpart in C# code. A feature activated event handler was supposed to add a new webpart to a page. Wiring everything up, testing the feature activation through the UI, everything was smooth. As a last step I made the feature hidden and tried to activate the feature through stsadm. And this is where I was left out of luck. STSADM only gave me a very helpful “Value cannot be null”. Digging deeper in the ULS log I caught a callstack which showed that there is some problem getting the SPContext.&lt;/p&gt;  &lt;p&gt;To go around this problem, the easiest way is to create a fake SPContext. &lt;a href="http://blog.mastykarz.nl/structured-and-repeatable-deployment-of-content-query-web-part-instances/"&gt;Waldek&lt;/a&gt; and &lt;a href="http://solutionizing.net/2009/02/16/faking-spcontext/"&gt;Keith&lt;/a&gt; have some great suggestions. The idea is pretty simple:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (HttpContext.Current == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;   HttpRequest request = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; HttpRequest(&lt;span style="color: #b71515"&gt;&amp;quot;&amp;quot;&lt;/span&gt;, web.Url, &lt;span style="color: #b71515"&gt;&amp;quot;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;   HttpContext.Current = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; HttpContext(request,&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; HttpResponse(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; StringWriter()));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;   HttpContext.Current.Items[&lt;span style="color: #b71515"&gt;&amp;quot;HttpHandlerSPWeb&amp;quot;&lt;/span&gt;] = web;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; // your code goes here&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Be aware that this trick only works when you are working with an SPWeb level object. When dealing with SPList or lower hierarchy items you need to go an other way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10179454" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=cbq-5Bzx5qU:Sg1rOmloOPs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/cbq-5Bzx5qU" height="1" width="1"/&gt;</description></item><item><title>Publishing start and end dates are set brute force</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/04/26/publishing-start-and-end-dates-are-set-brute-force.aspx</link><pubDate>Tue, 26 Apr 2011 21:18:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10158364</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10158364</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/04/26/publishing-start-and-end-dates-are-set-brute-force.aspx#comments</comments><description>&lt;p&gt;When setting publishing start and end dates on a publishing page, these dates will be saved in the PublishStartDate and PublishEndDate fields of the publishing page. Changing the scheduling settings will result in an immediate change of the page (with the modified by and modified date properties set as well), regardless of the state of the page (draft, pending, etc.).&lt;/p&gt;  &lt;p&gt;An interesting anomaly I have faced recently (and the source of this discovery) was that when using custom field controls to values of some custom fields and trying to access the values of PublishStartDate or PublishEndDate, these fields contain the values that were present on the ListItem when the pagelayout used to edit the publishing page has loaded.&lt;/p&gt;  &lt;p&gt;So imagine the following flow of user actions:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Open page for editing&lt;/li&gt;    &lt;li&gt;Use the Schedule button in the ribbon&lt;/li&gt;    &lt;li&gt;Set some scheduling dates and click ok&lt;/li&gt;    &lt;li&gt;The modal dialog disappears (and your page loads some info through JavaScript from the server)&lt;/li&gt;    &lt;li&gt;Save the page&lt;/li&gt;    &lt;li&gt;Field controls are asked to provide values of their controls so these can be saved to the appropriate field&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;At this point I would expect that the following code would return the dates set in step 3:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; Value&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     get&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         SPFieldDateTime pubStart = &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.Fields.GetFieldByInternalName(&lt;span style="color: #b71515"&gt;&amp;quot;PublishStartDate&amp;quot;&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; SPFieldDateTime;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; ListItem[pubStart.Id];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     set&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.Value = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Interestingly this is not the case, the values set in step 3 are not retained. My logic would tell me that the ListItem object would be built from scratch at step 5 resulting in the query of properties (changed in step 3). Any ideas what’s happening here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10158364" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=qydhrMRkU9k:CM-iAjL6pmM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/qydhrMRkU9k" height="1" width="1"/&gt;</description></item><item><title>Anatomy of page lifecycles in SharePoint 2010 publishing pages</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/04/26/anatomy-of-page-lifecycles-in-sharepoint-2010-publishing-pages.aspx</link><pubDate>Tue, 26 Apr 2011 21:02:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10158352</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10158352</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/04/26/anatomy-of-page-lifecycles-in-sharepoint-2010-publishing-pages.aspx#comments</comments><description>&lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;As most of you already know, SharePoint 2010 brings a whole load of nice publishing features out of the box. One of these are the handling of publishing pages. Publishing pages are basically .aspx pages that get their content from the listitem associated to them. You can imagine a publishing page much like any other document you would put in a document library. Specialty of these pages is that it stores most of its contents in its properties. If you go ahead and check any publishing page in the Pages document library you will find columns like Page Content, Title, Page Image. These are inserted into the “slots” of the page layout associated with the content type of the publishing page. These slots (content placeholders) are defined in page layouts by using field controls.&lt;/p&gt;  &lt;p&gt;Going back to our original topic, these publishing pages behave pretty similar to documents in terms of lifecycle management. Every document has the following aspects of lifecycle properties:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;version (major and minor) &lt;/li&gt;    &lt;li&gt;check-out state: checked-out (long-term or short-term), checked-in &lt;/li&gt;    &lt;li&gt;approval state: draft, pending, rejected, approved, scheduled &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Let’s take versions for first. When enabling major and minor versioning (default on the Pages document library on publishing sites) every document starts with version 0.1. Minor versions (0.1, 0.2, 1.1, 1.2, etc.) can only be seen by users with editor rights on the page. Major versions can be seen by read-only users as well. This provides with a nice way of preparing content for general consumption while not showing anything to unauthorized users.&lt;/p&gt;  &lt;p&gt;A typical workflow would be:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;0.1&lt;/strong&gt; --- save ---&amp;gt; &lt;strong&gt;0.2&lt;/strong&gt; --- save ---&amp;gt; &lt;strong&gt;0.3&lt;/strong&gt; … any number of minor versions …. --- publish ---&amp;gt; &lt;strong&gt;1.0&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When reaching a major version the page content will be visible to users with just read permissions. This version of the page will remain visible until an other major version is published. The tricky thing is that if you go ahead and edit version 1.0 and save (check-in) SharePoint will create a version 1.1 while still showing version 1.0 to read-only users. This way you can continue preparing your version 2.0 and only show it to users when you feel like it’s ready.&lt;/p&gt;  &lt;p&gt;Check-in and check-out provides a simple way of letting other editors know that you are working on a specific page. While a page is checked out to you, no other editor will be able to edit the page. Users with editor rights can Undo checkout which means that changes to a page (content and also changes in webparts) will be undone and checked-in state will be restored.&lt;/p&gt;  &lt;p&gt;Approval state complicates the picture by introducing a new attribute to versions. Content approval can be enabled without using versions as well, in this case it functions as a yes-no switch on the visibility of the page to read-only users. Things get more complicated when using major and minor versions. A usual version flow would be as follows:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;0.1 draft&lt;/strong&gt; --- save ---&amp;gt; &lt;strong&gt;0.2 draft&lt;/strong&gt; --- save ---&amp;gt; &lt;strong&gt;0.3 draft&lt;/strong&gt; … any number of draft minor versions … --- publish ---&amp;gt;&lt;strong&gt; 1.0 pending&lt;/strong&gt; --- approve ---&amp;gt;&lt;strong&gt; 1.0 approved&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Content approval is started as soon as you publish a major version. After the page is approved, read-only users will start to see the modifications made since the last approved major version.&lt;/p&gt;  &lt;p&gt;Content approval scheduling (or simply scheduling) adds a way to postpone the approval process to a specific time. During this time the status of the page will be 1.0 scheduled to show that it will be visible to read-only users at a later time. Scheduling works by employing a scheduled job that runs every minute and checks if the Publishing start date (or Publishing end date) has been reached. If yes, the job sets approval on the page accordingly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10158352" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=YRH1zK-89to:2O1uqQJlBqQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/YRH1zK-89to" height="1" width="1"/&gt;</description></item><item><title>Setting Modified by, Editor and other fields when versioning and content approval is enabled</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/04/26/setting-modified-by-editor-and-other-fields-when-versioning-and-content-approval-is-enabled.aspx</link><pubDate>Tue, 26 Apr 2011 20:08:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10158327</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10158327</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/04/26/setting-modified-by-editor-and-other-fields-when-versioning-and-content-approval-is-enabled.aspx#comments</comments><description>&lt;p&gt;Most of you are probably aware that setting fields like Modified, Editor, Created and Author require some special attention: &lt;/p&gt;  &lt;p style="background: white"&gt;   &lt;p style="background: white"&gt;&lt;span style="font-family: consolas; color: black; font-size: 10pt"&gt;&lt;/span&gt;&lt;/p&gt;    &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SPSite site = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SPSite(&lt;span style="color: #b71515"&gt;&amp;quot;http://sp2010&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SPWeb web = site.OpenWeb())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     SPFile f = web.GetFile(&lt;span style="color: #b71515"&gt;&amp;quot;/Pages/default.aspx&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     f.Item[&lt;span style="color: #b71515"&gt;&amp;quot;Modified&amp;quot;&lt;/span&gt;] = DateTime.Now.AddDays(-2);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     f.Item[&lt;span style="color: #b71515"&gt;&amp;quot;Editor&amp;quot;&lt;/span&gt;] = &lt;span style="color: #b71515"&gt;&amp;quot;-1;#SHAREPOINT\\SYSTEM&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     f.Item.UpdateOverwriteVersion();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt;So far so good. What happens when content versioning is enabled? calling UpdateOverwriteVersion() results in a new minor version and the approval state going to Pending. The best I could figure out is the following: &lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SPSite site = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SPSite(&lt;span style="color: #b71515"&gt;&amp;quot;http://sp2010&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (SPWeb web = site.OpenWeb())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     SPFile f = web.GetFile(&lt;span style="color: #b71515"&gt;&amp;quot;/Pages/default.aspx&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     f.Item[&lt;span style="color: #b71515"&gt;&amp;quot;Modified&amp;quot;&lt;/span&gt;] = DateTime.Now.AddDays(-2);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     f.Item[&lt;span style="color: #b71515"&gt;&amp;quot;Editor&amp;quot;&lt;/span&gt;] = &lt;span style="color: #b71515"&gt;&amp;quot;-1;#SHAREPOINT\\SYSTEM&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     f.Item.UpdateOverwriteVersion();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     f = web.GetFile(&lt;span style="color: #b71515"&gt;&amp;quot;/Pages/default.aspx&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     f.Item.ModerationInformation.Status = SPModerationStatusType.Approved;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;     f.Item.Update();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Using this method you can set all fields but the Modified date, which will be set to the time of the approval.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10158327" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=Aidi9kMrEhU:OysphZTFvtI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/Aidi9kMrEhU" height="1" width="1"/&gt;</description></item><item><title>The mystery around Excel Services and the Secure store</title><link>http://blogs.msdn.com/b/andrasg/archive/2011/01/19/the-mystery-around-excel-services-and-the-secure-store.aspx</link><pubDate>Wed, 19 Jan 2011 01:10:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10117386</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10117386</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2011/01/19/the-mystery-around-excel-services-and-the-secure-store.aspx#comments</comments><description>&lt;p&gt;Sooner or later in the life of a SharePoint admin there will be a time when the dreaded Secure Store Service will have to be configured. Usually this time comes when Excel Services has to be configured to map certain users to a predefined account to enable data refresh.&lt;/p&gt;  &lt;p&gt;When using Excel Services data refresh can happen in the following ways:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Using user account delegation &lt;/li&gt;    &lt;li&gt;Using a predefined account &lt;/li&gt;    &lt;li&gt;Using anonymous connection &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Let’s look at each of these methods in detail:&lt;/p&gt;  &lt;p&gt;&lt;u&gt;User account delegation&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;When using delegation, Excel Services will attempt to use the logged on user’s identity to authenticate to the external data source.&lt;/p&gt;  &lt;p&gt;In SharePoint 2007 delegation worked by using Kerberos Constrained Delegation (CD). A big drawback of this solution was that it had to be configured end-to-end, so the Web Application had to support it, Excel Services had to be configured, the external data source had to be configured and also quite some work was needed with (fake) SPNs and delegation rules.&lt;/p&gt;  &lt;p&gt;Fortunately this has changed quite a lot in SharePoint 2010. With the use of claims based authentication, delegation got a lot simpler. As long as you are using Claims – Windows Authentication on the Web Application and have the Claims to Windows Token Service (C2WTS) configured no double-hop scenario is produced and authentication delegation can succeed.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Predefined account&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;When using a predefined account, Excel Services will use the account you have configured to access the external data source. This account can be any account you specify. You will need to take care of updating the password of this account when it changes.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Anonymous&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;It’s pretty self-explanatory, Excel Services will not attempt to authenticate against the external data source.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Influencing which of these methods Excel Services will be using can be a little tricky. Excel Services will use what it is instructed to use in the connection definition. To complicate things even further this connection definition could be in a separate file (eg: .odc file in a data connection repository) or embedded in the Excel file. If the Excel file contains a reference to a connection definition file it will be used.&lt;/p&gt;  &lt;p&gt;The most important setting in the selection process is set on the following panel:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-28-85-metablogapi/2086.image_5F00_5AC9EB61.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; 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://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-28-85-metablogapi/2677.image_5F00_thumb_5F00_7F0ECFE3.png" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The settings are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Windows Authentication &lt;/li&gt;    &lt;li&gt;SSS &lt;/li&gt;    &lt;li&gt;None &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So what do these mean?&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Windows Authentication&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Excel Services will try to delegate the logged on users’ identity to the external data source. This will only succeed if the following are true:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The Web Application you are using is set to Claims – Windows Authentication (NTLM or Negotiate)&lt;/li&gt;    &lt;li&gt;C2WTS is configured and running&lt;/li&gt;    &lt;li&gt;Kerberos authentication and constrained delegation are configured from the C2WTS identity to the external data source.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In SharePoint 2007 using this setting was only possible after Kerberos Constrained Delegation was fully configured for the whole path (user – Web Application – Excel Services – external data source).&lt;/p&gt;  &lt;p&gt;&lt;u&gt;SSS (SSO)&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;When choosing this authentication method Excel Services will use the Secure Store Service to find a Target Application ID matching what you enter here. Credentials you have set for this application will be used to access the external data source. As this practically breaks the hops into one-hop journeys, there’s no need for Kerberos configuration.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;None&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Usually this choice causes the most headaches when not configured properly. In this case the authentication scheme specified in the connection string will be passed to the database provider. In case Windows Authentication is specified in the connection string, the Unattended Account will be used. If a specific username and password is set, those will be used.&lt;/p&gt;  &lt;p&gt;In case the Unattended Account is selected, Excel Services will try to go to the Secure Store Service and fetch a credential identified by the Unattended Account Application ID in the Excel Services Settings page:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-28-85-metablogapi/7776.image_5F00_62B167F6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; 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://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-28-85-metablogapi/8865.image_5F00_thumb_5F00_79903972.png" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So now we understand where Excel Services is looking for the credential to use. What happens when Excel Services tries to fetch a credential from the Secure Store Service? To understand what’s happening, let’s separate the case when SSS is set in the connection and when None is set and the Unattended Account is used.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;SSS – in this case Excel Services looks up (in the context of the logged on user) the target application in the Secure Store Service and verifies if the current logged on user is amongst the credential owners of the target application. If not, you will get an Access Denied exception similar to the following in the ULS log:      &lt;br /&gt;      &lt;br /&gt;&lt;font size="2" face="Consolas"&gt;The Microsoft Secure Store Service application Secure Store Service Application failed to retrieve credentials. The error returned was “Access is denied”.        &lt;br /&gt;&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;None – in this case Excel Services will be using the Unattended Account specified in Excel Services settings. The target application will be looked up, but in this case the context of Excel Services will be used. So when specifying the Credential Owner of the target application, add the service account of Excel Services as well. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;As you can see it is pretty important to set the Credential Owner for the target application. Unfortunately I haven’t found any good way to change the Credential Owner after creating the target application. I have also not found a way to find out what account you have set to be used to access the external data source. This makes configuring the target application a bit tricky…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;More info on the topic:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://technet.microsoft.com/en-us/library/ee662541.aspx" href="http://technet.microsoft.com/en-us/library/ee662541.aspx" target="_blank"&gt;Plan Excel Services authentication (SharePoint Server 2010)&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10117386" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=Uy-YG1k1CLM:P5gumPevYAw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/Uy-YG1k1CLM" height="1" width="1"/&gt;</description></item><item><title>SharePoint and the favicon</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/12/14/sharepoint-and-the-favicon.aspx</link><pubDate>Tue, 14 Dec 2010 15:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10104721</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10104721</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/12/14/sharepoint-and-the-favicon.aspx#comments</comments><description>&lt;p&gt;Setting a page’s favicon is pretty easy in 2010:&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;SharePoint:SPShortcutIcon runat=&amp;quot;server&amp;quot; IconUrl=&amp;quot;/_layouts/images/favicon.ico&amp;quot;/&amp;gt;&lt;/pre&gt;

&lt;p&gt;Now try this with an icon coming from the Style Library:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;SharePoint:SPShortcutIcon runat=&amp;quot;server&amp;quot; IconUrl=&amp;quot;/Style Library/favicon.ico&amp;quot;/&amp;gt;&lt;/pre&gt;

&lt;p&gt;You think you have nailed it, right? Fire up IE8 running on XP and you’ll see it won’t appear.&lt;/p&gt;

&lt;p&gt;Here’s the fix:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;SharePoint:SPShortcutIcon runat=&amp;quot;server&amp;quot; IconUrl=&amp;quot;/Style%20Library/favicon.ico&amp;quot;/&amp;gt;&lt;/pre&gt;

&lt;p&gt;Took me some time to figure out…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10104721" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=LnFLbWBxaig:54dByLSFN80:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/LnFLbWBxaig" height="1" width="1"/&gt;</description></item><item><title>Error creating a sitecollection when using custom claims providers</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/11/18/error-creating-a-sitecollection-when-using-custom-claims-providers.aspx</link><pubDate>Thu, 18 Nov 2010 19:06:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10093444</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10093444</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/11/18/error-creating-a-sitecollection-when-using-custom-claims-providers.aspx#comments</comments><description>&lt;p&gt;Just came across a problem where the creation of a site collection would fail with no real informative error message. If you are using custom claims providers you might be running into the situation described in Steve Peschka’s blog:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.technet.com/b/speschka/archive/2010/11/15/problems-resolving-claims-names-in-sharepoint-2010.aspx" href="http://blogs.technet.com/b/speschka/archive/2010/11/15/problems-resolving-claims-names-in-sharepoint-2010.aspx"&gt;http://blogs.technet.com/b/speschka/archive/2010/11/15/problems-resolving-claims-names-in-sharepoint-2010.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Most probably the problem is that the claims provider doesn’t handle the user “NT AUTHORITY\authenticated users” well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10093444" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=RKW6S0LFBTk:cLl1vZSbnIc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/RKW6S0LFBTk" height="1" width="1"/&gt;</description></item><item><title>Using long usernames in profile import</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/10/28/using-long-usernames-in-profile-import.aspx</link><pubDate>Thu, 28 Oct 2010 21:52:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10082478</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10082478</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/10/28/using-long-usernames-in-profile-import.aspx#comments</comments><description>&lt;p&gt;Today I discovered a really weird thing on profile import. If you try to set the connection account to an account with a name longer than 20 characters, profile import will claim that the username or password is invalid. In this case, try entering the “pre-Windows 2000” logon name of the account (which is by default the user logon name trimmed to 20 chars).&lt;/p&gt;  &lt;p&gt;Voilá.&lt;/p&gt;  &lt;p&gt;Took me a few hours to figure out…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10082478" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=Py7ToRpapjI:gyHSpSwKB0k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/Py7ToRpapjI" height="1" width="1"/&gt;</description></item><item><title>Setting the super user account on SharePoint 2010 and getting Access Denied errors afterwards</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/09/30/setting-the-super-user-account-on-sharepoint-2010-and-getting-access-denied-errors-afterwards.aspx</link><pubDate>Thu, 30 Sep 2010 21:13:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10070026</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>13</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10070026</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/09/30/setting-the-super-user-account-on-sharepoint-2010-and-getting-access-denied-errors-afterwards.aspx#comments</comments><description>&lt;p&gt;By default after installing SharePoint 2010 you will probably soon encounter the following two error messages in the Application log:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;Object Cache: The super user account utilized by the cache is not configured. This can increase the number of cache misses, which causes the page requests to consume unneccesary system resources.        &lt;br /&gt;To configure the account use the following command ‘stsadm -o setproperty -propertyname portalsuperuseraccount -propertyvalue account -url webappurl’. The account should be any account that has Full Control access to the SharePoint databases but is not an application pool account.         &lt;br /&gt;Additional Data:         &lt;br /&gt;Current default super user account: SHAREPOINT\system         &lt;br /&gt;&lt;/font&gt;&lt;strong&gt;       &lt;br /&gt;&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Consolas"&gt;Object Cache: The super reader account utilized by the cache does not have sufficient permissions to SharePoint databases.        &lt;br /&gt;To configure the account use the following command 'stsadm -o setproperty -propertyname portalsuperreaderaccount -propertyvalue account -url webappurl'. It should be configured to be an account that has Read access to the SharePoint databases.         &lt;br /&gt;Additional Data:         &lt;br /&gt;Current default super reader account: NT AUTHORITY\LOCAL SERVICE &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Source of the error is as the &lt;a href="http://technet.microsoft.com/en-us/library/ff758656.aspx" target="_blank"&gt;Technet documentation&lt;/a&gt; says:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;By default, the Portal Super User account is the site’s System Account, and the Portal Super Reader account is NT Authority\Local Service. There are two main issues with using the out-of-box accounts.&lt;/p&gt;    &lt;ol&gt;     &lt;li&gt;The first issue is that some items get checked out to System Account, so when a query that includes these items is made, the checked out version of the item is returned instead of the latest published version. This is a problem because it is not what a user would expect to have returned, so the cache has to make a second query to fetch the correct version of the file. This negatively affects server performance for every request that includes these items. The same problem would occur for any user who has items checked out, if that user’s account was set to be the Portal Super User account. This is why the accounts configured to be the Portal Super User and the Portal Super Reader should not be user accounts that are used to log into the site. This ensures that the user does not inadvertently check items out and cause problems with performance. &lt;/li&gt;      &lt;li&gt;The default Portal Super Reader account is NT Authority\Local Service, which is not correctly resolved in a claims authentication application. As a result, if the Portal Super Reader account is not explicitly configured for a claims authentication application, browsing to site collections under this application will result in an “Access Denied” error, even for the site administrator. This error will occur on any site that uses any feature that explicitly uses the object cache, such as the SharePoint Server Publishing Infrastructure, metadata navigation, the Content Query Web Part, or navigation. &lt;/li&gt;   &lt;/ol&gt; &lt;/blockquote&gt;  &lt;p&gt;So keeping these values on their default value on an intranet/extranet portal is not such a good idea. Let’s go ahead and set these two, according to the suggestions in the error message!&lt;/p&gt;  &lt;pre class="brush: ps"&gt;stsadm -o setproperty -pn portalsuperuseraccount -pv DOMAIN\user -url http://webappurl
stsadm -o setproperty -pn portalsuperreaderaccount -pv DOMAIN\user -url http://webappurl
iisreset&lt;/pre&gt;

&lt;p&gt;After doing so, you’re either done, or – in case you are in claims mode – will see Access Denied on all pages on the webapplication you set the accounts.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Moral of the story: &lt;strong&gt;if you are in claims mode, you will need to use the claims user name &lt;/strong&gt;(i:0#.w|domain\user).&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Relevant sections of the &lt;a href="http://technet.microsoft.com/en-us/library/ff758656.aspx" target="_blank"&gt;Technet article&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;14. Make note of how the names for the Object Cache Super Reader and Object Cache Super User accounts are displayed in the &lt;strong&gt;User Name&lt;/strong&gt; column. &lt;font style="background-color: #ffff00"&gt;The displayed strings will be different depending on whether you are using claims authentication for the Web application&lt;/font&gt;.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Copy the following code and paste it into a text editor, such as Notepad:&lt;/p&gt;

    &lt;pre class="brush: ps;"&gt;$wa = Get-SPWebApplication -Identity &amp;quot;&amp;lt;WebApplication&amp;gt;&amp;quot; 
$wa.Properties[&amp;quot;portalsuperuseraccount&amp;quot;] = &amp;quot;&amp;lt;SuperUser&amp;gt;&amp;quot; 
$wa.Properties[&amp;quot;portalsuperreaderaccount&amp;quot;] = &amp;quot;&amp;lt;SuperReader&amp;gt;&amp;quot; 
$wa.Update()&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;p&gt;Replace the following placeholders with values:&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;&lt;em&gt;&amp;lt;WebApplication&amp;gt;&lt;/em&gt; is the name of the Web application to which the accounts will be added. &lt;/li&gt;

      &lt;li&gt;&lt;em&gt;&amp;lt;SuperUser&amp;gt;&lt;/em&gt; is the account to use for the Portal Super User account&lt;font style="background-color: #ffff00"&gt; as you saw it displayed in the &lt;strong&gt;User Column&lt;/strong&gt; field&lt;/font&gt; mentioned in Step 14 of the previous procedure. &lt;/li&gt;

      &lt;li&gt;&lt;em&gt;&amp;lt;SuperReader&amp;gt;&lt;/em&gt; is account to use for the Portal Super Reader account &lt;font style="background-color: #ffff00"&gt;as you saw it displayed in the &lt;strong&gt;User Column&lt;/strong&gt; field&lt;/font&gt; mentioned in Step 14 of the previous procedure. &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10070026" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=H2mgQsxWja8:Ohfby4ljfr8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/H2mgQsxWja8" height="1" width="1"/&gt;</description></item><item><title>SharePoint 2010 Kerberos Guide</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/09/01/sharepoint-2010-kerberos-guide.aspx</link><pubDate>Tue, 31 Aug 2010 23:50:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10056593</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10056593</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/09/01/sharepoint-2010-kerberos-guide.aspx#comments</comments><description>&lt;p&gt;A really comprehensive guide on SharePoint 2010 identity scenarios. It is a must read for everyone planning a SharePoint 2010 deployment.&lt;/p&gt;  &lt;p&gt;Grab it from here: &lt;a href="http://download.microsoft.com/download/B/B/F/BBF0C6F3-6E36-4979-8C43-DE165AD7AE34/SP2010%20Kerberos%20Guide.docx"&gt;http://download.microsoft.com/download/B/B/F/BBF0C6F3-6E36-4979-8C43-DE165AD7AE34/SP2010 Kerberos Guide.docx&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10056593" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=KHkG2_UOIaE:-w-qgSVE2Ac:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/KHkG2_UOIaE" height="1" width="1"/&gt;</description></item><item><title>Getting the User Profile Sync Service running on SharePoint 2010</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/06/16/user-profile-service-miseries.aspx</link><pubDate>Wed, 16 Jun 2010 22:59:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10026161</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10026161</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/06/16/user-profile-service-miseries.aspx#comments</comments><description>&lt;p&gt;If the User Profile Sync service is causing you constant headaches, here’s a mini howto for getting it work:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Keep things together – Stop all instances of the User Profile Service (UPS) and User Profile Sync Service (UPSS). If the UPSS is stuck in starting state, look for a One-Time job named User Profile Service provisioning (unprovisioning) job. My general recommendation is to have only one instance of the UPS running. You should also have only one instance of UPSS running in your farm! &lt;/li&gt;    &lt;li&gt;Usually it’s a wise decision to start from scratch – This means to remove the User Profile Service Application (UPA) and get a new one. This of course means that all what you have synced so far will have to be synced again. Be warned! &lt;/li&gt;    &lt;li&gt;Make sure your farm account is amongst the Local Administrators on the computer you wish the UPSS to be running on. Don’t forget to restart the SharePoint 14 Timer Service (or restart the whole box) after changing the group membership! &lt;/li&gt;    &lt;li&gt;Make sure you don’t have remains of previous Sync, Profile or Social DBs. &lt;/li&gt;    &lt;li&gt;Again make sure, all UPS and UPSS are stopped on all servers in your farm &lt;/li&gt;    &lt;li&gt;Create a new UPA &lt;/li&gt;    &lt;li&gt;Grab ULSViewer (get it from &lt;a href="http://code.msdn.microsoft.com/ULSViewer" target="_blank"&gt;here&lt;/a&gt;) and set a filter to Category contains “profile” and start monitoring your ULS log on the box you want to start ULSS on. &lt;/li&gt;    &lt;li&gt;Start ULSS – type your farm account password. &lt;/li&gt;    &lt;li&gt;Watch ULSViewer for any problems&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If your ULSS has started successfully and all your services are on the same box, don’t forget to do an IISRESET. If you miss this step, clicking the UPA in Manage Service Applications results in an unknown error with the ULS log containing:&lt;/p&gt;  &lt;p&gt;UserProfileServiceUserStatisticsWebPart:LoadControl failed, Exception: System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10026161" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=mhzx_7MOy38:jceZMxuX7o4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/mhzx_7MOy38" height="1" width="1"/&gt;</description></item><item><title>Federation extensions for MOSS2007</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/06/01/federation-extensions-for-moss2007.aspx</link><pubDate>Tue, 01 Jun 2010 19:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10018418</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10018418</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/06/01/federation-extensions-for-moss2007.aspx#comments</comments><description>&lt;p&gt;The Geneva team has just released a package to support MOSS 2007 deployments with ADFS 2.0.&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://blogs.msdn.com/b/card/archive/2010/06/01/announcing-the-rtw-of-federation-extensions-for-sharepoint-3-0.aspx"&gt;Announcing the RTW of Federation Extensions for SharePoint 3.0 !!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It even includes RMS config!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10018418" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=ZD7MbEAU7lU:2ddZJKuV-bg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/ZD7MbEAU7lU" height="1" width="1"/&gt;</description><category domain="http://blogs.msdn.com/b/andrasg/archive/tags/ADFS/">ADFS</category><category domain="http://blogs.msdn.com/b/andrasg/archive/tags/SharePoint+2007/">SharePoint 2007</category></item><item><title>ADFS 2.0 RTW</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/05/06/adfs-2-0-rtw.aspx</link><pubDate>Thu, 06 May 2010 08:29:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10008344</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10008344</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/05/06/adfs-2-0-rtw.aspx#comments</comments><description>&lt;p&gt;ADFS 2.0 has RTMed. You can grab it here: &lt;a title="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=118c3588-9070-426a-b655-6cec0a92c10b" href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=118c3588-9070-426a-b655-6cec0a92c10b"&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=118c3588-9070-426a-b655-6cec0a92c10b&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can also find the Geneva team’s announcement here: &lt;a title="AD FS 2.0 is here!" href="http://blogs.msdn.com/card/archive/2010/05/05/ad-fs-2-0-is-here.aspx"&gt;AD FS 2.0 is here!&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10008344" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=2YxMBbgBULE:htSgS7dqVn0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/2YxMBbgBULE" height="1" width="1"/&gt;</description><category domain="http://blogs.msdn.com/b/andrasg/archive/tags/ADFS/">ADFS</category></item><item><title>Setting up SharePoint 2010 Excel Services to get external data</title><link>http://blogs.msdn.com/b/andrasg/archive/2010/05/04/setting-up-sharepoint-2010-excel-services-to-get-external-data.aspx</link><pubDate>Tue, 04 May 2010 19:25:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10007315</guid><dc:creator>AndrasGaal</dc:creator><slash:comments>9</slash:comments><wfw:commentRss>http://blogs.msdn.com/b/andrasg/rsscomments.aspx?WeblogPostID=10007315</wfw:commentRss><comments>http://blogs.msdn.com/b/andrasg/archive/2010/05/04/setting-up-sharepoint-2010-excel-services-to-get-external-data.aspx#comments</comments><description>&lt;p&gt;Some of you out there might just want to run as far as possible when having to configure SharePoint 2007 Excel Services to refresh data from an external SQL or OLAP source using the logged on users’ credentials. &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/blogfiles/andrasg/WindowsLiveWriter/6f69a30e25d0_11CA4/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;  &lt;p&gt;The process involved configuring SPNs for quite some services, taking care of delegation, configuring ECS to use Kerberos and then usually a lot of hair pulling and tracing using netmon.&lt;/p&gt;  &lt;p&gt;The reason for using Kerberos is quite simple: you need Kerberos to work around double or multi-hop authentication scenarios. For example in 2007, the user authenticated to the web frontend (1 hop), the web frontend contacted ECS running under the SSP (2 hops) which in turn went back to fetch data from the SQL Server or Analysis Services (3 hops).&lt;/p&gt;  &lt;p&gt;Good news is that in SharePoint 2010 things got quite simple thanks to claims based authentication. As you might know SharePoint 2010 does claims based auth among its components, so the whole 2-3-many hops problem is now eliminated.&lt;/p&gt;  &lt;p&gt;SharePoint 2010 solves this by having the user authenticate to the web frontend (either using Kerberos or NTLM – note: SAML won’t work here!) and then continuing to the Excel Services web service app using claims based auth. Thanks to claims, doing multiple hops is not a problem. The interesting part in continuing with the request is when ECS wants to fetch the necessary data from the external data source. As SQL and Analysis Services cannot be accessed using claims based auth (this changes in 2008R2 – &lt;a href="http://msdn.microsoft.com/en-us/library/ff487970(v=SQL.105).aspx" target="_blank"&gt;Reporting Services will support it&lt;/a&gt; in SharePoint integrated mode) some magic is done and the claims token is converted back to a Windows (Kerberos) token. This magic is done by the service called Claims to Windows token service (c2wts) which is installed by default in SharePoint 2010.&lt;/p&gt;  &lt;p&gt;In order for c2wts to work, you need to make sure, that the user running this service is trusted to transform claims to windows tokens by verifying the following in c2wtshost.exe.config (usually in C:\Program Files\Windows Identity Foundation\v3.5):&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;windowsTokenService&amp;gt;
    &amp;lt;allowedCallers&amp;gt;
      &amp;lt;clear/&amp;gt;
      &amp;lt;add value=&amp;quot;WSS_WPG&amp;quot; /&amp;gt;
    &amp;lt;/allowedCallers&amp;gt;
  &amp;lt;/windowsTokenService&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/pre&gt;

&lt;p&gt;Usually when setting the C2WTS to a custom domain account, it is added to the WSS_WPG group, so probably you won’t need to modify the config.&lt;/p&gt;

&lt;p&gt;To successfully authenticate to the external datasource, first it needs to be configured to support Kerberos auth (for SQL: &lt;a href="http://msdn.microsoft.com/en-us/library/cc280745(v=SQL.100).aspx" target="_blank"&gt;Using Kerberos Authentication with SQL Server&lt;/a&gt;, for Analysis Services: &lt;a href="http://support.microsoft.com/kb/917409" target="_blank"&gt;How to configure SQL Server 2008 Analysis Services and SQL Server 2005 Analysis Services to use Kerberos authentication&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;Next step is to allow the service account running the c2wts service delegation to the external data sources. This can be done on the delegation tab of the user account properties in Active Directory Users and Computers (ADUC).&lt;/p&gt;

&lt;p&gt;Lastly configure delegation from the account running Excel Services to the external data sources.&lt;/p&gt;

&lt;p&gt;Now you only need to make sure that the Excel Services calculation method is set to “Impersonate” and the document library in which your xlsx file resides is included in the trusted locations of ECS.&lt;/p&gt;

&lt;p&gt;If everything is right, data refresh should succeed. If not, refer to the ULS log for errors.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;UPDATE (05/14)&lt;/strong&gt;: Fiddling with the c2wts service I discovered that it only works if the Windows service is set to LocalSystem identity. If you give it a custom identity it fails with:&lt;/p&gt;

&lt;p&gt;&lt;font face="Consolas"&gt;&lt;/font&gt;

  &lt;pre class="brush: plain;"&gt;SPSecurityContext.WindowsIdentity: Could not retrieve a valid windows identity for NTName='test\user', UPN='user@test.local'. UPN is required when Kerberos constrained delegation is used. Exception: System.ArgumentException: Token cannot be zero.    
at System.Security.Principal.WindowsIdentity.CreateFromToken(IntPtr userToken)    
at System.Security.Principal.WindowsIdentity..ctor(IntPtr userToken, String authType, Int32 isAuthenticated)    
at System.Security.Principal.WindowsIdentity..ctor(IntPtr userToken)    
at Microsoft.IdentityModel.WindowsTokenService.S4UClient.CallService(Func`2 contractOperation)    
at Microsoft.SharePoint.SPSecurityContext.GetWindowsIdentity().&lt;/pre&gt;
&lt;/p&gt;



&lt;p&gt;Stay tuned for an update on this. Running C2WTS under LocalSystem will trip a health validator rule in SharePoint and you’ll get a warning.&lt;/p&gt;

&lt;p&gt;There’s a quite good article over at technet on this topic: &lt;a href="http://technet.microsoft.com/en-us/library/ee806887(office.14).aspx" target="_blank"&gt;Configure Kerberos authentication for the claims to Windows token service (SharePoint Server 2010)&lt;/a&gt;. Worth a read.&lt;/p&gt;

&lt;br /&gt;

&lt;p&gt;&lt;strong&gt;UPDATE (06/17):&lt;/strong&gt; Lee Graber has a nice writeup on the topic Claims to Windows token topic: &lt;a href="http://powerpivotgeek.com/2010/05/21/testing-the-claims-to-windows-token-service-for-different-identities/" target="_blank"&gt;Testing the Claims To Windows Token Service for different identities&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On the same note, the required user rights for the account running the C2WTS are “Act as a part of the operating system” and “Logon as a service”. &lt;/p&gt;

&lt;br /&gt;

&lt;p&gt;&lt;strong&gt;UPDATE (09/01):&lt;/strong&gt; The &lt;a href="http://go.microsoft.com/fwlink/?LinkID=196600" target="_blank"&gt;SharePoint 2010 Kerberos Guide&lt;/a&gt; has a good summary of all necessary settings. To get c2wts working under a domain account instead of LocalSystem, give the account the following permissions on the box running the service. Don’t forget to restart the service after granting the rights!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Act as part of the operating system &lt;/li&gt;

  &lt;li&gt;Impersonate a client after authentication &lt;/li&gt;

  &lt;li&gt;Log on as a service &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To revert back to LocalSystem use the following PowerShell commands:&lt;/p&gt;

&lt;pre class="brush: ps;"&gt;$claims = Get-SPServiceInstance | where {$_.TypeName -eq &amp;quot;Claims to Windows Token Service&amp;quot;} 
$claims.Service.ProcessIdentity.CurrentIdentityType = 0 
$claims.Service.ProcessIdentity.Update()&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;UPDATE (09/26/11): &lt;/strong&gt;Reviewed some parts of the article and corrected a few things. Thanks Mads for the hints! &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-28-85-metablogapi/0676.wlEmoticon_2D00_smile_5F00_3657D02D.png" /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;delegation will only work if you have Claims – Windows auth (either NTLM or Kerberos) but not ADFS (SAML)&lt;/li&gt;

  &lt;li&gt;usually there’s no need to fiddle with the c2wts config.&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10007315" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/SharepointAdventures?a=JfbbC3I5xiA:dpeEgLlY7Vw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/SharepointAdventures?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/SharepointAdventures/~4/JfbbC3I5xiA" height="1" width="1"/&gt;</description><category domain="http://blogs.msdn.com/b/andrasg/archive/tags/SharePoint+2010/">SharePoint 2010</category><category domain="http://blogs.msdn.com/b/andrasg/archive/tags/ADFS/">ADFS</category></item></channel></rss>
