<?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>TCSC Blog</title>
	<atom:link href="http://www.tcscblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tcscblog.com</link>
	<description>TCSC Blog</description>
	<lastBuildDate>Wed, 16 May 2012 11:51:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>On WCF Performance</title>
		<link>http://www.tcscblog.com/2012/05/15/on-wcf-performance/</link>
		<comments>http://www.tcscblog.com/2012/05/15/on-wcf-performance/#comments</comments>
		<pubDate>Wed, 16 May 2012 03:00:10 +0000</pubDate>
		<dc:creator>David Romig, Sr.</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2246</guid>
		<description><![CDATA[Most introductory WCF materials show you how to mark complex data types as serializable. But there are few materials that show how to optimize communication of complex WCF data structures. In this post, I’ll review a couple of issues related &#8230; <a href="http://www.tcscblog.com/2012/05/15/on-wcf-performance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Most introductory WCF materials show you how to mark complex data types as serializable. But there are few materials that show how to optimize communication of complex WCF data structures. In this post, I’ll review a couple of issues related to efficiently communicating complex types in WCF.</p>
<p>One of the greatest impacts on WCF performance is the cost of serialization and de-serialization (converting binary data to / from Xml). The WebSocket binding in .NET Framework 4.5 will remove much of the performance penalty of (de)serialization incurred over the http(s) protocols. So the best optimization is to avoid (de)serialization when your target infrastructure supports it by configuring WCF to use NetTcp or (when available) WebSocket binding.</p>
<p>But in today’s world, you frequently must serialize complex data types by decorating classes with the serialization attributes <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractattribute.aspx">DataContract</a>, <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.aspx">DataMember</a>, <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.enummemberattribute.aspx">EnumMember</a> and <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx">ServiceKnownType</a> attributes. Some applications use <em>sparsley populated</em> data types. A sparsley populated type is one where many members contain the default value (zero for value types or null for reference types). You fine tune performance of your complex WCF data types by properly setting the<a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.isrequired.aspx"> IsRequired</a> and <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.emitdefaultvalue.aspx">EmitDefault</a> properties of the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.aspx">DataMember</a> serialization attribute to implement the typical tradeoff between data size and processing time.<a href="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-1.png" rel="lightbox[2246]" title="Service Contract"><img class="aligncenter size-full wp-image-2250" title="Service Contract" src="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-1.png" alt="Service Contract" width="872" height="247" /></a><a href="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-2.png" rel="lightbox[2246]" title="Enum Data Contract"><img class="aligncenter size-full wp-image-2251" title="Enum Data Contract" src="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-2.png" alt="Enum Data Contract with Serialization Attributes" width="872" height="306" /></a></p>
<p>Note in Figure 1 that we have decorated the interface with the <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceknowntypeattribute.aspx">ServiceKnownType</a> attribute to ensure that the serializer understands how to serialize the Status enumeration. If you explicitly assign values to enumeration members as shown in Figure 2, ensure that you assign one of the members the value zero. Enum is a value type with the default value zero. If zero is not defined as a valid enumeration value, the serializer throws a SerializationException during creation of the enumeration.</p>
<p>You can mark non-required members with the <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.isrequired.aspx">IsRequired</a>=false and <a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.emitdefaultvalue.aspx">EmitDefault</a>=false attribute properties to reduce the number of bytes transmitted by WCF. Keep in mind that the default value for a reference type is “null” and for a value type is 0. In particular, be aware of the difference between a zero-length string and a null string variable.</p>
<p>The following example illustrates these points.</p>
<div>
<p><a href="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-3.png" rel="lightbox[2246]" title="Data Contract with Serialization Attributes"><img class="aligncenter size-full wp-image-2254" title="Data Contract with Serialization Attributes" src="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-3.png" alt="Data Contract with Serialization Attributes" width="871" height="312" /></a>The data contract attributes shown in Figure 3 specify that the serializer may omit the members (IsRequired = false) and that when a member has the default value, the serializer omits it from the serialized output (EmitDefaultValue = false). The method uses the same complex type both as a method argument and the return value. You can see the request and response message bodies in Figure 4 and Figure 5. The de-serializer invokes the type’s default constructor then parses each value and assigns it to the type member. In this example, all values are defaults so there are no values to parse or assign!</p>
<p><img class="aligncenter size-full wp-image-2257" title="WCF SOAP Request Body with Serialization Attributes" src="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-4.png" alt="WCF SOAP Request Body with Serialization Attributes" width="866" height="195" /><img class="aligncenter size-full wp-image-2258" title="WCF SOAP Response Body with Serialization Attributes" src="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-5.png" alt="WCF SOAP Response Body with Serialization Attributes" width="869" height="191" /></p>
<p>The data contract for the UnAttributedType example shown in Figure 6, accepts the default ‘true’ value for the <a title="DataMember" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.aspx" target="_blank">DataMember</a>, <a title="IsRequired" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.isrequired.aspx" target="_blank">IsRequired</a> and <a title="EmitDefault" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datamemberattribute.emitdefaultvalue.aspx" target="_blank">EmitDefault</a> properties for all type members. Therefore, when you accept the default settings, the serializer represents all tags and all default values &#8220;<em>on the wire</em>&#8220;.</p>
<p><img class="aligncenter size-full wp-image-2261" title="Data contract with default serialization attributes" src="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-6.png" alt="Data contract with default serialization attributes" width="871" height="433" />As you can see in Figure 7 and Figure 8, the request and response message bodies contain all the member elements with default values in their serialized form. The de-serializer must parse each value and assign it to the type member. While this is inconsequential in these simple examples, in a production environment handling large arrays of types with many members, you could see a significant difference.</p>
<p><img class="aligncenter size-full wp-image-2262" title="WCF SOAP Request Body without Serialization Attributes" src="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-7.png" alt="WCF SOAP Request Body without Serialization Attributes" width="871" height="248" /></p>
<p><img class="aligncenter size-full wp-image-2263" title="WCF SOAP Response Body without Serialization Attributes" src="http://www.tcscblog.com/wp-content/uploads/2012/05/WCF-Blog-Entry-Figure-8.png" alt="WCF SOAP Response Body without Serialization Attributes" width="871" height="252" /></p>
<p>In this post, we’ve discussed optimizing complex types for communication by WCF, noting that (de)serialization can be a significant performance factor. Therefore, using binary communication over TCP or WebSocket binding reduces these performance costs. We also reviewed several serialization attribute properties that can optimize how WCF (de)serializes complex data types.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/05/15/on-wcf-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Site Custom Quota Template Not Applying</title>
		<link>http://www.tcscblog.com/2012/05/15/my-site-custom-quota-template-not-applying/</link>
		<comments>http://www.tcscblog.com/2012/05/15/my-site-custom-quota-template-not-applying/#comments</comments>
		<pubDate>Tue, 15 May 2012 19:03:44 +0000</pubDate>
		<dc:creator>Adam Preston</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2229</guid>
		<description><![CDATA[A SharePoint 2010 Quick Tip: The My Site web app is hardcoded to only use the &#8220;Personal Site&#8221; quota template. So, if you try to create a custom template and apply that – think again. The template will not be &#8230; <a href="http://www.tcscblog.com/2012/05/15/my-site-custom-quota-template-not-applying/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A SharePoint 2010 Quick Tip: The My Site web app is hardcoded to only use the &#8220;<strong>Personal Site</strong>&#8221; quota template. So, if you try to create a custom template and apply that – think again. The template will not be applied and thus newly created My Sites will have unlimited storage.</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/05/051512_1902_MySiteCusto1.png" alt="" /></p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/05/051512_1902_MySiteCusto2.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/05/15/my-site-custom-quota-template-not-applying/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitecore Quick Tips &#8211; Device Fallback</title>
		<link>http://www.tcscblog.com/2012/05/11/sitecore-quick-tips-device-fallback/</link>
		<comments>http://www.tcscblog.com/2012/05/11/sitecore-quick-tips-device-fallback/#comments</comments>
		<pubDate>Sat, 12 May 2012 03:02:42 +0000</pubDate>
		<dc:creator>Rick Matherly</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Sitecore]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2215</guid>
		<description><![CDATA[I needed a print version of a page that was different enough to make using CSS print styles impractical, so I decided to use the Print device in Sitecore. I setup the Print device to detect the query string &#8220;p=1&#8243;, &#8230; <a href="http://www.tcscblog.com/2012/05/11/sitecore-quick-tips-device-fallback/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I needed a print version of a page that was different enough to make using CSS print styles impractical, so I decided to use the Print device in Sitecore. I setup the Print device to detect the query string &#8220;p=1&#8243;, then setup the layout for the Print device.</p>
<p>This worked great until I realized (when a user reported the bug) that I had used the query string &#8220;p=1&#8243; on a different page to mean something totally different. This page was returning a &#8220;Page Not Found&#8221; error because the query string was triggering the Print device and there was no layout defined for the Print device.</p>
<p>I found a quick fix was to specify a Fallback device for the Print device so that a given page will fallback to the Default device if there is no layout defined for the Print device. I would definitely recommend using the Fallback device field&#8230; it will most likely prevent bugs and save you a headache in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/05/11/sitecore-quick-tips-device-fallback/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preventing Cross-Site Links in Sitecore</title>
		<link>http://www.tcscblog.com/2012/05/01/preventing-cross-site-links-in-sitecore/</link>
		<comments>http://www.tcscblog.com/2012/05/01/preventing-cross-site-links-in-sitecore/#comments</comments>
		<pubDate>Wed, 02 May 2012 03:16:08 +0000</pubDate>
		<dc:creator>Rick Matherly</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Sitecore]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2200</guid>
		<description><![CDATA[I have multiple sites setup in one Sitecore instance; and host names are used in the web.config &#8220;sites&#8221; section to manage this: &#60;site name=&#8221;site1&#8243; hostName=&#8221;www.site1.com&#8221; rootPath=&#8221;/sitecore/content/site1&#8243; &#8230; &#62; &#60;site name=&#8221;site2&#8243; hostName=&#8221;www.site2.com&#8221; rootPath=&#8221;/sitecore/content/site2&#8243; &#8230; &#62; I recently discovered some strange URLs &#8230; <a href="http://www.tcscblog.com/2012/05/01/preventing-cross-site-links-in-sitecore/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have multiple sites setup in one Sitecore instance; and host names are used in the web.config &#8220;sites&#8221; section to manage this:</p>
<p style="color: #222; padding: 20px; background-color: #f7f7f7;">
&lt;site name=&#8221;site1&#8243; hostName=&#8221;www.site1.com&#8221; rootPath=&#8221;/sitecore/content/site1&#8243; &#8230; &gt;<br />
&lt;site name=&#8221;site2&#8243; hostName=&#8221;www.site2.com&#8221; rootPath=&#8221;/sitecore/content/site2&#8243; &#8230; &gt;
</p>
<p>I recently discovered some strange URLs showing up in the search results of a popular search engine.  They were using the format: http://www.site1.com/sitecore/content/site2/page.aspx.  While this is technically a valid URL in Sitecore, it is not really desirable, and the pages don&#8217;t always work correctly this way.  I believe the Rendering.SiteResolving setting is supposed to handle this by automatically changing the host name to match the rootPath, but it doesn&#8217;t work for these sites.  This seems to be due to a bug as described <a href="http://sitecorepm.wordpress.com/2011/06/15/using-cross-site-links-aka-dynamic-links-part-2/">here</a>.</p>
<p>I decided to simply return a 404 when there is a mismatch between the host name and rootPath.  A 404 seems resonable in this case, and it should stop these URLs from getting indexing.</p>
<p>I had already implemented a custom 404 processor as described <a href="http://larsnielsen.blogspirit.com/archive/2007/10/17/modifying-the-httprequest-pipeline-custom-404-handler.html">here</a>, so I just added some logic to the existing class:</p>
<p style="color: #222; padding: 20px; background-color: #f7f7f7;">
using Sitecore.Pipelines.HttpRequest;<br />
&nbsp;<br />
namespace CustomSitecoreProcessors<br />
{<br />
&nbsp;&nbsp;public class PageNotFoundRequestProcessor : HttpRequestProcessor<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;public override void Process(HttpRequestArgs args)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (Sitecore.Context.Site == null || Sitecore.Context.Database == null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var pageFound = (Sitecore.Context.Item != null);<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// If there is an item and the &#8220;checkRootPath&#8221; property is true, make sure the root path is going to the correct site (if present)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (pageFound &#038;&#038; GetBoolSiteProperty(&#8220;checkRootPath&#8221;, false))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (args.Url.FilePath.Contains(&#8220;/sitecore/content&#8221;) &#038;&#038; !args.Url.FilePath.Contains(Sitecore.Context.Site.RootPath))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pageFound = false;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Expect a Page Not Found item in the root of the site<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!pageFound)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var itemPath = Sitecore.Context.Site.RootPath + &#8220;/pagenotfound&#8221;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sitecore.Context.Item = Sitecore.Context.Database.GetItem(itemPath);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;private bool GetBoolSiteProperty(string propertyName, bool defaultValue)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var value = Sitecore.Context.Site.Properties[propertyName];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (value == null)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return defaultValue;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bool boolValue;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (bool.TryParse(value, out boolValue))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return boolValue;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return defaultValue;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
}
</p>
<p>To make this configurable, I use a &#8220;checkRootPath&#8221; attribute added to the &#8220;site&#8221; elemements.  That way, I can impose the rootPath checking only on my custom website and leave the typical Sitecore sites, like shell, alone:</p>
<p style="color: #222; padding: 20px; background-color: #f7f7f7;">
&lt;site name=&#8221;site1&#8243; hostName=&#8221;www.site1.com&#8221; rootPath=&#8221;/sitecore/content/site1&#8243; &#8230; checkRootPath=&#8221;true&#8221; &gt;<br />
&lt;site name=&#8221;site2&#8243; hostName=&#8221;www.site2.com&#8221; rootPath=&#8221;/sitecore/content/site2&#8243; &#8230; checkRootPath=&#8221;true&#8221; &gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/05/01/preventing-cross-site-links-in-sitecore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reset Customized List Forms from InfoPath back to Default</title>
		<link>http://www.tcscblog.com/2012/04/30/reset-customized-list-forms-from-infopath-back-to-default/</link>
		<comments>http://www.tcscblog.com/2012/04/30/reset-customized-list-forms-from-infopath-back-to-default/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 10:12:23 +0000</pubDate>
		<dc:creator>Adam Preston</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2195</guid>
		<description><![CDATA[If you have a SharePoint 2010 List Form that you have customized using InfoPath and for whatever reason need to revert back to the default forms, then follow this simple process below:   Customized form to replace Located the list &#8230; <a href="http://www.tcscblog.com/2012/04/30/reset-customized-list-forms-from-infopath-back-to-default/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you have a SharePoint 2010 List Form that you have customized using InfoPath and for whatever reason need to revert back to the default forms, then follow this simple process below:
</p>
<p>
 </p>
<p><strong>Customized form to replace<br />
</strong></p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/04/043012_1011_ResetCustom1.png" alt=""/>
	</p>
<p>Located the list in question and use the ribbon to select <strong>List &gt; List Settings</strong>
	</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/04/043012_1011_ResetCustom2.png" alt=""/>
	</p>
<p>On the List Settings page, select &#8220;<strong>Form settings</strong>&#8221; under &#8220;<strong>General Settings</strong>&#8220;.
</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/04/043012_1011_ResetCustom3.png" alt=""/>
	</p>
<p>Change the Form Option from &#8220;<strong>Modify the existing InfoPath form</strong>&#8221; to &#8220;<strong>Use the default SharePoint form</strong>&#8220;. If you want to completely remove the form, also check &#8220;<strong>Delete the InfoPath Form from the server</strong>&#8220;.
</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/04/043012_1011_ResetCustom4.png" alt=""/>
	</p>
<p>The list form has now been reset back to the default.
</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/04/043012_1011_ResetCustom5.png" alt=""/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/04/30/reset-customized-list-forms-from-infopath-back-to-default/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Office Web Apps across Site Collections using PowerShell</title>
		<link>http://www.tcscblog.com/2012/04/09/enable-office-web-apps-across-site-collections-using-powershell/</link>
		<comments>http://www.tcscblog.com/2012/04/09/enable-office-web-apps-across-site-collections-using-powershell/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 15:11:15 +0000</pubDate>
		<dc:creator>Adam Preston</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Office Web Apps]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2180</guid>
		<description><![CDATA[So you have installed and configured the amazing Office Web Apps for SharePoint 2010. You are now at the step of activating it for your users. Perform this quick tip to use PowerShell to activate the feature across all of &#8230; <a href="http://www.tcscblog.com/2012/04/09/enable-office-web-apps-across-site-collections-using-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So you have installed and configured the amazing <a href="http://technet.microsoft.com/en-us/library/ff431685.aspx">Office Web Apps for SharePoint 2010</a>. You are now at the step of activating it for your users. Perform this quick tip to use PowerShell to activate the feature across all of your site collections within a given web application.</p>
<ul>
<li>Open the SharePoint 2010 Management Shell with a properly privileged account.</li>
<li>
<div>Type or paste in the following to obtain the Office Web Apps Feature</div>
<p style="margin-left: 36pt;"><span style="font-family: Lucida Console; font-size: 10pt;">$webApps = $(Get-SPFeature -limit all | where {$_.displayname -eq &#8220;OfficeWebApps&#8221;}).Id<br />
</span></p>
</li>
<li>
<div>Type or paste in the below command to loop through each site collection and activate Office Web Apps</div>
<p style="margin-left: 36pt;"><span style="font-family: Lucida Console; font-size: 10pt;">Get-SPWebApplication -identity &#8220;http://portal.mywebappurl.com&#8221; | Get-SPSite -limit all | %{Enable-SPFeature $webApps -Url $_.URL}<br />
</span></p>
<p style="margin-left: 36pt;"><span style="font-size: 10pt;"><strong><em>Note:</em></strong> Modify the Identity parameter for Get-SPWebApplication to match your environment<br />
</span></p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/04/09/enable-office-web-apps-across-site-collections-using-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Overloading vs. Optional Parameters</title>
		<link>http://www.tcscblog.com/2012/03/29/overloading-vs-optional-parameters/</link>
		<comments>http://www.tcscblog.com/2012/03/29/overloading-vs-optional-parameters/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 22:58:11 +0000</pubDate>
		<dc:creator>Rick Matherly</dc:creator>
				<category><![CDATA[.Net]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2168</guid>
		<description><![CDATA[I recently needed to add a new parameter to an existing method, and I didn&#8217;t want to update or break any existing code.  Normally, I just make an overloaded method, but this time I decided to use a relatively new &#8230; <a href="http://www.tcscblog.com/2012/03/29/overloading-vs-optional-parameters/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently needed to add a new parameter to an existing method, and I didn&#8217;t want to update or break any existing code.  Normally, I just make an overloaded method, but this time I decided to use a relatively new feature in C#, optional parameters.  In my case, this turned out to be a mistake.</p>
<p>Because my DLL got unintentially deployed without the rest of the code, I found out the hard way that adding an optional parameter breaks binary compatibility.  You can use ISDASL to verify this.  An overload creates two separate methods, so the original method signature stays intact.  Adding an optional parameter modifies the original method signature to add the new parameter with an [opt] designation. Calling this method with one parameter will work just fine after a compile, but it is not binary campatible with the original version.</p>
<p>To conclude, I&#8217;m not advocating for or against optional parameters. I think there are times when overloading makes sense and times when optional parameters make sense.  Hopefully, knowing about this little &#8220;gotcha&#8221; will prevent you from having unexpected compatibility issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/03/29/overloading-vs-optional-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Database Backup and Restoring it in Code</title>
		<link>http://www.tcscblog.com/2012/03/27/creating-a-database-backup-and-restoring-it-in-code/</link>
		<comments>http://www.tcscblog.com/2012/03/27/creating-a-database-backup-and-restoring-it-in-code/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 12:32:33 +0000</pubDate>
		<dc:creator>Tom Becker</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2152</guid>
		<description><![CDATA[When running regression tests many times you have to rely on very specific bits of data to be present in your database for the correct results to come out reliably.  This can typically be handled by a few simple inserts &#8230; <a href="http://www.tcscblog.com/2012/03/27/creating-a-database-backup-and-restoring-it-in-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When running regression tests many times you have to rely on very specific bits of data to be present in your database for the correct results to come out reliably.  This can typically be handled by a few simple inserts and deletes to massage the data that you need.  Other times there is just too much data to handle in that way.  So you need to just start from scratch and re-create your database.</p>
<p>That is all well and good if you are on a dedicated test box where you can blow away your database without any consequences.  But say you wanted to run your test bed from your local box where you are actively working and you need to keep the database changes that you have made that aren’t ready for prime time.   You will want to backup your database, run the tests and then restore it at the end, so that your working database remains intact.  I don’t know about you, but I don’t think I would remember to do that manually every time a regression test is run.</p>
<p>To mitigate this process I created two functions that would backup and restore the database so I wouldn’t have to remember any more.  The two functions rely heavily on <a href="http://msdn.microsoft.com/en-us/library/ms162169.">SQL Server Management Objects</a> (SMO) and in order to work with the SMO you must add the following references to your projects.</p>
<p><a href="http://www.tcscblog.com/wp-content/uploads/2012/03/backupRestore_Includes.png" rel="lightbox[2152]" title="backupRestore_Includes"><img class="alignnone size-full wp-image-2153" title="backupRestore_Includes" src="http://www.tcscblog.com/wp-content/uploads/2012/03/backupRestore_Includes.png" alt="Include Files" width="246" height="67" /></a></p>
<p>The functions below each take three parameters.</p>
<p>1)      path, this is where you want the file to be saved to, including filename.</p>
<p>2)      databaseName, what database do you want to backup/restore</p>
<p>3)      server, on what server does this database live.</p>
<p><strong>We’ll start with the backup.</strong></p>
<p><a href="http://www.tcscblog.com/wp-content/uploads/2012/03/backupRestore_BackupCode.png" rel="lightbox[2152]" title="backupRestore_BackupCode"><img class="alignnone size-full wp-image-2154" title="backupRestore_BackupCode" src="http://www.tcscblog.com/wp-content/uploads/2012/03/backupRestore_BackupCode.png" alt="Backup Code" width="599" height="369" /></a></p>
<p>As you can see there isn’t much to it.  Create the backup device which is essentially the backup file.  You create a backup, and add the device.  Then call the function SqlBackup and pass in the server you are using.  This will save a file to whatever destination you supplied.  Remember in this example the path does contain the file name as well.</p>
<p><strong>Now onto the restore:</strong></p>
<p><a href="http://www.tcscblog.com/wp-content/uploads/2012/03/backupRestore_RestoreCode.png" rel="lightbox[2152]" title="backupRestore_RestoreCode"><img class="alignnone size-full wp-image-2155" title="backupRestore_RestoreCode" src="http://www.tcscblog.com/wp-content/uploads/2012/03/backupRestore_RestoreCode.png" alt="Restore Code" width="551" height="453" /></a></p>
<p>This looks pretty similar to the BackupDatabase function with a few minor differences. The biggest difference would be the KillDatabase method call.  It is important to note that this function will kill all active connections to your database, and then proceed to drop your database.  In my case, since we are immediately going to restore the database that isn’t an issue.  If you cannot drop your database then you will have to set the database to single user mode and then restore.  I will not be going into that here.</p>
<p>I initially had the NoRecovery option on the Restore object set to true and it would give a success message from the restore but it would never quite finish the restore.  If I opened up SSMS I would set my database name followed by (Restoring…) and it would never stop.  I changed the no recovery to false and it worked like a charm.  For more information on why it was in a restoring state here is some <a href="http://social.msdn.microsoft.com/Forums/en-US/sqldatabasemirroring/thread/19f38353-0553-43f7-a65d-67bba432d0e1/">further reading.</a></p>
<p>Now all you have to do is call these functions at the start and end of your regression test run and you can keep your database from getting wiped.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/03/27/creating-a-database-backup-and-restoring-it-in-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hey Virginia! Have You Heard About SHARE: The SharePoint Conference for Business Users?</title>
		<link>http://www.tcscblog.com/2012/03/26/share2012/</link>
		<comments>http://www.tcscblog.com/2012/03/26/share2012/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 15:02:54 +0000</pubDate>
		<dc:creator>bjs</dc:creator>
				<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2142</guid>
		<description><![CDATA[If you are in the SharePoint community and follow me at all (@sharepointmom), you know that I am VERY passionate about our SharePoint community.  Not just our local community but the global SharePoint community.  The main thing missing since I &#8230; <a href="http://www.tcscblog.com/2012/03/26/share2012/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are in the SharePoint community and follow me at all (@sharepointmom), you know that I am VERY passionate about our SharePoint community.  Not just our local community but the global SharePoint community.  The main thing missing since I started my journey has been end user resources!  To think that an entire conference could be dedicated to business end users would have been a laughing matter a couple of years ago.  Thankfully, the business is being heard!  SHARE to the rescue!</p>
<p>Do we need another SharePoint conference?  It seems there is one happening every week, but do they really speak to the business users?  SHARE is only for the business and there is no geek speak.  Got a problem to solve and wondering if SharePoint is the answer? Well, a conference such as this is the place to go.  You will meet business solution professionals and leaders in the SharePoint world.  The other great thing about SHARE is that many are showcasing their sites and how SharePoint has solved their problems.  Come and hear Sarah Haase (@sarahhaase) feature her work at Best Buy or Mary Ann Lorkowski showcase Diebold’s solution with SharePoint. Hear from Coca-Cola, Baltimore County Public Schools, Bristol-Myers Squibb, and meet Michael Sampson, well-known author and end user advocate.  The list goes on.  You will also see @RichmondSUG’s past speakers Sue Hanley and Dux Sy!  (So glad to have them in our extended community!)</p>
<p>So, come to Atlanta, Georgia, April 23-26! It’s not too late to register.  Need to convince your boss that this conference is a must for YOU?  Download the Convince My Boss business case document at <a href="http://bit.ly/GVcy57">http://bit.ly/GVcy57</a>. (See links at <a href="http://www.shareconference.com/us">www.shareconference.com/us</a>.)</p>
<p>SHARE debuted in 2010 in Australia with so much success that the Australian business community brought it back for a second year.  SHARE Australia 2011 and SHARE South Africa 2012 were hits! The global wave continues and lands in Atlanta, April 23-26.  Don’t miss it!  The conference is sponsored by The Eventful Group, who continues to amaze everyone with their attention to details to make sure that each attendee gets the information and contacts he/she needs. (They rock!)</p>
<p>Also, don’t forget to come out to the Richmond SharePoint User Group. Yes, Richmond! We have a great group. More information at <a href="http://www.richmondsharepoint.org">www.richmondsharepoint.org</a>.</p>
<p><em>For more information on Share Conference and to register, visit </em><a href="http://www.shareconference.com/us"><em>http://www.shareconference.com/us</em></a><em>. </em></p>
<p><em>Article submitted by Bonnie J. Surma, SharePoint Community Evangelist, SharePoint End User Support Consultant for TCSC, Midlothian, Virginia; Sponsor Manager for NothingButSharePoint.com; Advertising and Services Coordinator for SharePointJoel.com..  Follow her on Twitter @sharepointmom. </em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/03/26/share2012/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Microsoft Script Explorer for Windows PowerShell Review</title>
		<link>http://www.tcscblog.com/2012/03/14/microsoft-script-explorer-for-windows-powershell-review/</link>
		<comments>http://www.tcscblog.com/2012/03/14/microsoft-script-explorer-for-windows-powershell-review/#comments</comments>
		<pubDate>Wed, 14 Mar 2012 17:32:30 +0000</pubDate>
		<dc:creator>Adam Preston</dc:creator>
				<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.tcscblog.com/?p=2132</guid>
		<description><![CDATA[Recently Microsoft released the Microsoft Script Explorer for Windows PowerShell. Being that I dabble in PowerShell for SharePoint, this certainly got my interest. After what was a very quick installation, I launched the Script Explorer and was presented with a &#8230; <a href="http://www.tcscblog.com/2012/03/14/microsoft-script-explorer-for-windows-powershell-review/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently Microsoft released the <a href="http://www.microsoft.com/download/en/details.aspx?id=29101&amp;WT.mc_id=rss_alldownloads_all">Microsoft Script Explorer for Windows PowerShell</a>. Being that I dabble in PowerShell for SharePoint, this certainly got my interest. After what was a very quick installation, I launched the Script Explorer and was presented with a nice clean interface:</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc1.png" alt="" /></p>
<p>From the left you can see where to search against various resources including Scripts, Snippets, How-to Guidance and Modules.</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc2.png" alt="" /></p>
<p>Selecting any will change the Repositories below. Options include PoshCode, Bing Search, and even your local file system or network share (more on this at the end).</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc3.png" alt="" /></p>
<p>Lastly, you are given the option to select the Focus Areas. For me, I naturally chose SharePoint.</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc4.png" alt="" /></p>
<p>I then did a simple search for &#8220;Site Collection&#8221;, figuring this would generate sufficient results – and it did.</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc5.png" alt="" /></p>
<p>Since I know Brian Jackett is a PowerShell guru, I picked his from the top of the list. The bottom window pane updates to show the details of the script, ratings, and the script itself – much like on the TechNet Script Center.</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc6.png" alt="" /></p>
<p>From here I can either Save the script to my machine or copy it to use in a current script I&#8217;m perhaps building.</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc7.png" alt="" /></p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc8.png" alt="" /></p>
<p>This saves the PowerShell script directly to C:\Users\&lt;username&gt;\Documents\Microsoft Script Explorer\ (you can edit this save location through Tools &gt; Options)</p>
<p>The Script Explorer also provides a way to browse categories on the TechNet Script Center and explore community resources for free eBooks, tutorials and best practices.</p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc9.png" alt="" /></p>
<p><img src="http://www.tcscblog.com/wp-content/uploads/2012/03/031412_1730_MicrosoftSc10.png" alt="" /></p>
<p>Personally, I think this is a very valuable tool. I know I could just search Bing and get a similar result set. However, using the Script Explorer I can narrow my search to only PowerShell related resources and be given the opportunity to save and copy directly from the tool. More importantly, it&#8217;s clear that Microsoft is pushing PowerShell integration with all of their products – meaning that over the near future many organizations will have scripts stored locally or on network shares. Being able to use the Script Explorer to search and find scripts and snippets from those locations as well as the online user community will be extremely useful.</p>
<p>As a side note, here are some of what I think would be nice additions:</p>
<ul>
<li>Show rating column for TechNet Script Center so the users can sort by rating.</li>
<li>Perhaps combine this tool with the <a href="http://www.microsoft.com/resources/TechNet/en-us/Office/media/WindowsPowerShell/WindowsPowerShellCommandBuilder.html">PowerShell Command Builder</a> to provide a one stop shop</li>
<li>Be able to import modules and search against them</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.tcscblog.com/2012/03/14/microsoft-script-explorer-for-windows-powershell-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

