<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SharePoint &#187; Programming</title>
	<atom:link href="http://www.sharepointboris.net/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sharepointboris.net</link>
	<description>and Boris Gomiunik</description>
	<lastBuildDate>Thu, 22 Dec 2011 11:45:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Disaster recovery after uninstalling Project Server 2010</title>
		<link>http://www.sharepointboris.net/2011/10/disaster-recovery-after-uninstalling-project-server-2010/</link>
		<comments>http://www.sharepointboris.net/2011/10/disaster-recovery-after-uninstalling-project-server-2010/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 21:06:40 +0000</pubDate>
		<dc:creator>Boris</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Disaster]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Recovery]]></category>

		<guid isPermaLink="false">http://www.sharepointboris.net/2011/10/disaster-recovery-after-uninstalling-project-server-2010/</guid>
		<description><![CDATA[If you had installed Microsoft Project Server 2010 on a SharePoint server that had running SharePoint 2010 and afterwards you have uninstalled it you may have came in for a great shock. I know I was. After uninstalling Project 2010 I discovered that My Central Admin was gone All SharePoint sites were gone (also checking [...]]]></description>
			<content:encoded><![CDATA[<p>If you had installed Microsoft Project Server 2010 on a SharePoint server that had running SharePoint 2010 and afterwards you have uninstalled it you may have came in for a great shock. I know I was. After uninstalling Project 2010 I discovered that </p>
<ul>
<li>My Central Admin was gone</li>
<li>All SharePoint sites were gone (also checking in IIS)</li>
</ul>
<p>That may be a real shocker. One option is to simply rerun config wizard to have the Central admin site and restore entire farm from backup (you DO have backup, do you?). Otherwise here’s the process on how I recovered all the sites:</p>
<p><strong>Re-run SharePoint Products and Technologies Configuration Wizard</strong></p>
<ol>
<li>Run the SharePoint Products and Technologies Configuration Wizard</li>
<li>Rejoin the existing farm (entering database server and configuration database and farm passphrase of your lost SharePoint farm) – thank God these aren’t deleted</li>
<li>Central admin site has to be recreated</li>
</ol>
<p>After the configuration wizard has finished you should see all your web applications back in IIS</p>
<p><strong>Remake manual changes to web.config files</strong></p>
<p>If you were making manual changes (not through SharePoint Object Model) to web.config files of your web applications, these are lost, so you better keep track and remake those changes.</p>
<p><strong>Restart services</strong></p>
<p>Event though you may have your sites back there is still work to do. If you have custom solutions deployed to SharePoint, you have to re-deploy them. Fortunately these are still stored in SharePoint.</p>
<p>SharePoint service applications are not started and you may receive an error like &quot;There are no addresses available for this application&quot; (in logs, event viewer and of course in the web application.</p>
<ol>
<li>In SharePoint central administration open Application Management </li>
<li>Under Service Applications select Services on Server</li>
<li>Click Start next to service applications that you wish to restart.</li>
</ol>
<p>You will also notice virtual applications reappearing in your IIS under your SharePoint Services IIS site.</p>
<p><strong>Redeploy solutions</strong></p>
<p>OMG, also solutions are gone from web applications. Yes you need to re-deploy these as well. </p>
<ol>
<li>In SharePoint Central Administration select System Settings</li>
<li>Select Manage Farm solutions</li>
<li>You will see that all solutions are (probably) there but none of them is deployed. </li>
<li>Deploy each solution as needed by selecting the solution and clicking “Deploy solution” and following steps.</li>
</ol>
<p><strong>Review</strong></p>
<p>After redeploying check your web applications if everything is working correctly. I noticed even though solutions were not deployed, the data, configuration and permissions remained.</p>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2011/10/disaster-recovery-after-uninstalling-project-server-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CAML query not considering time for Date and time field</title>
		<link>http://www.sharepointboris.net/2009/10/caml-query-not-considering-time-for-date-and-time-field/</link>
		<comments>http://www.sharepointboris.net/2009/10/caml-query-not-considering-time-for-date-and-time-field/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 08:16:45 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[CAML]]></category>

		<guid isPermaLink="false">http://www.sharepointboris.net/2009/10/caml-query-not-considering-time-for-date-and-time-field/</guid>
		<description><![CDATA[If you’re having trouble constructing your CAML query and you have a DateTime field with time enabled, the important fact that plain &#60;Value Type=&#34;DateTime&#34;&#62;2009-10-28T10:00:00Z&#60;/Value&#62; will ignore the time part of the query. It is useful for querying whole days. If Time part of the DateTime field is also important to consider (you&#8217;re querying specific time [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re having trouble constructing your CAML query and you have a DateTime field with time enabled, the important fact that plain <strong>&lt;Value Type=&quot;DateTime&quot;&gt;2009-10-28T10:00:00Z&lt;/Value&gt;</strong> will ignore the time part of the query. It is useful for querying whole days. If Time part of the DateTime field is also important to consider (you&#8217;re querying specific time of the day, you have to add parameter <strong>IncludeTimeValue=&quot;TRUE&quot;</strong> parameter. So the whole CAML node would be</p>
<p><strong>&lt;Value <strong>IncludeTimeValue=&quot;TRUE&quot;</strong> Type=&quot;DateTime&quot;&gt;2009-10-28T10:00:00Z&lt;/Value&gt;</strong></p>
<p>Thanks, <a href="http://ucsharp.wordpress.com/2007/10/11/9/" target="_blank">ucsharp</a> for publishing this.</p>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2009/10/caml-query-not-considering-time-for-date-and-time-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MOSS Lanugage pack installation without CD/DVD</title>
		<link>http://www.sharepointboris.net/2009/09/moss-lanugage-pack-installation-without-cddvd/</link>
		<comments>http://www.sharepointboris.net/2009/09/moss-lanugage-pack-installation-without-cddvd/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 10:14:34 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[CodePlex]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.sharepointboris.net/2009/09/moss-lanugage-pack-installation-without-cddvd/</guid>
		<description><![CDATA[MOSS 2007 Lanugage Pack comes in .img format, which you can burn to a CD and then use it for installing Language pack. If you’re working remotely or working with a server that has no CD/DVD drive, this might pose a slight problem. You can avoid this in a simple way: 1. Rename the .img [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2447426b-8689-4768-bff0-cbb511599a45&amp;displaylang=en" target="_blank">MOSS 2007 Lanugage Pack</a> comes in .img format, which you can burn to a CD and then use it for installing Language pack. If you’re working remotely or working with a server that has no CD/DVD drive, this might pose a slight problem. </p>
<p>You can avoid this in a simple way:</p>
<p>1. Rename the .img file into an .iso file.</p>
<p>2. Download <a href="http://portableapps.com/apps/utilities/7-zip_portable" target="_blank">7-zip portable version</a> and extract the executable to a folder on your server desktop.</p>
<p>3. Navigate to the extracted folder and run 7-ZipPortable.exe.</p>
<p>4. Browse and open (double-click) the renamed .iso file    <br /><a href="http://boris.gomiunik.net/wp-content/uploads/2009/09/image.png" rel="lightbox[481]" title="image"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://boris.gomiunik.net/wp-content/uploads/2009/09/image_thumb.png" width="337" height="232" /></a> </p>
<p>5. You can extract all files from the .iso to another folder on your desktop<a href="http://boris.gomiunik.net/wp-content/uploads/2009/09/image1.png" rel="lightbox[481]" title="image">      <br /><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://boris.gomiunik.net/wp-content/uploads/2009/09/image_thumb1.png" width="418" height="296" /></a> </p>
<p>Now you can browse to that folder and run the setup of language pack with no problem.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:84fe55f4-7998-47a5-93b0-11ce1b730eba" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/MOSS" rel="tag">MOSS</a>,<a href="http://technorati.com/tags/MOSS+language+pack" rel="tag">MOSS language pack</a>,<a href="http://technorati.com/tags/SharePoint" rel="tag">SharePoint</a>,<a href="http://technorati.com/tags/7-zip" rel="tag">7-zip</a>,<a href="http://technorati.com/tags/iso" rel="tag">iso</a></div>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2009/09/moss-lanugage-pack-installation-without-cddvd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SPSecurity.RunWithElevatedPrivileges and Access Denied error on event receiver</title>
		<link>http://www.sharepointboris.net/2009/04/spsecurityrunwithelevatedprivileges-and-access-denied-error-on-event-receiver/</link>
		<comments>http://www.sharepointboris.net/2009/04/spsecurityrunwithelevatedprivileges-and-access-denied-error-on-event-receiver/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 11:25:06 +0000</pubDate>
		<dc:creator>Boris Gomiunik</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://boris.gomiunik.net/2009/04/spsecurityrunwithelevatedprivileges-and-access-denied-error-on-event-receiver/</guid>
		<description><![CDATA[After looksing half a day for a st00pid mistake I have to write about this to warn anyone that might run into similar problem. In VS I’ve prepared a custom event receiver which needed to be run as system account (for performing actions that the user running the event receiver doesn’t have – like setting [...]]]></description>
			<content:encoded><![CDATA[<p>After looksing half a day for a st00pid mistake I have to write about this to warn anyone that might run into similar problem.</p>
<p>In VS I’ve prepared a custom event receiver which needed to be run as system account (for performing actions that the user running the event receiver doesn’t have – like setting permissions, creating subwebs,…)</p>
<p>So my code began with something lilke that:</p>
<p>…</p>
<p>public override void ItemUpdated(SPItemEventProperties properties)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; base.ItemUpdated(properties);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _properties = properties; </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //povišamo pravice na sistemski račun in zaženemo private metodo   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPSecurity.RunWithElevatedPrivileges(doSomethingWithThis);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private void doSomethingWithThis()   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPSite site = new SPSite(_properties.SiteId);   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPWeb web = site.OpenWeb(_properties.RelativeWebUrl);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPListItem item = web.Lists[_properties.ListItem]</p>
<p>…</p>
<p>after running it and tracing the error I’ve always received “Access denied” error. How come, if I’m running the code with elevated privileges. Do I need even a higher privilege?</p>
<p>After countless attempts to impersonate an administrator or app pool account (I’m still a rookie at this), I’ve discovered that the SPItemEventProperties are instantiated with privileges of user that triggered the event receiver. The error was in my last line (of the example above) &#8212; <strong>_properties.ListItem</strong> still holds the rights of the original user. so fixed my code to</p>
<p>…</p>
<p>public override void ItemUpdated(SPItemEventProperties properties)   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; base.ItemUpdated(properties);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _properties = properties; </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //povišamo pravice na sistemski račun in zaženemo private metodo   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPSecurity.RunWithElevatedPrivileges(ustvariPonudbaSubsite);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; } </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private void ustvariPonudbaSubsite()   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPSite site = new SPSite(_properties.SiteId);   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPWeb web = site.OpenWeb(_properties.RelativeWebUrl);    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SPListItem item = web.Lists[<strong>_properties.ListId].GetItemById(_properties.ListItem.ID</strong>);</p>
<p>…</p>
<p>With that change I’ve open the SPListItem object as system account and magically everything started working as it should! The same goes for site and web object. If you need to run actions with elevated privileges on SPSite and SPWeb object use</p>
<p><strong>new SPSite(_properties.SiteId);     <br /></strong>and    <br /><strong>site.OpenWeb(_properties.RelativeWebUrl)</strong> </p>
<p>instead of </p>
<p><strong>_properties.web</strong>    <br />and    <br /><strong>web.site;</strong></p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2692cfb0-c1e1-472f-95b0-dcce40c8b158" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/SharePoint" rel="tag">SharePoint</a>,<a href="http://technorati.com/tags/programming" rel="tag">programming</a>,<a href="http://technorati.com/tags/c%23" rel="tag">c#</a>,<a href="http://technorati.com/tags/event+receiver" rel="tag">event receiver</a>,<a href="http://technorati.com/tags/user+rights" rel="tag">user rights</a></div>
<p><!-- PHP 5.x --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sharepointboris.net/2009/04/spsecurityrunwithelevatedprivileges-and-access-denied-error-on-event-receiver/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

