<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Point Deep</title>
	<atom:link href="http://mundeep.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mundeep.wordpress.com</link>
	<description>Mundeep&#039;s Tech Blog</description>
	<lastBuildDate>Tue, 17 Jan 2012 12:44:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mundeep.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Point Deep</title>
		<link>http://mundeep.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mundeep.wordpress.com/osd.xml" title="Point Deep" />
	<atom:link rel='hub' href='http://mundeep.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Active Directory Users and Computers MMC Snapin for Windows 2008</title>
		<link>http://mundeep.wordpress.com/2011/12/28/active-directory-users-and-computers-mmc-snapin-for-windows-2008/</link>
		<comments>http://mundeep.wordpress.com/2011/12/28/active-directory-users-and-computers-mmc-snapin-for-windows-2008/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 10:17:46 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[administration tools]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=228</guid>
		<description><![CDATA[Having recently been required to do a fresh install of Windows 2008 R2 for a new development server i was having trouble finding where to install the Active Directory Users and Computers MMC snapin. Essentially you need to install the &#8220;Active Directory Domain Controller Tools&#8221; via: Server Manager -&#62; Features -&#62; Add Features And then: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=228&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having recently been required to do a fresh install of Windows 2008 R2 for a new development server i was having trouble finding where to install the Active Directory Users and Computers MMC snapin.</p>
<p>Essentially you need to install the <em>&#8220;Active Directory Domain Controller Tools&#8221;</em> via:</p>
<p>Server Manager -&gt; Features -&gt; Add Features</p>
<p>And then: Remote Server Administration Tools -&gt; Role Administration Tools -&gt; Active Directory Domain Services Tools -&gt; Active Directory Domain Controller Tools</p>
<p>Of all the places on the web i actually found this answer via the Microsoft Connect forums<br />
<a href="http://connect.microsoft.com/WindowsServerFeedback/feedback/details/490592/" title="AD Users &amp; MMC Snapin">http://connect.microsoft.com/WindowsServerFeedback/feedback/details/490592/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=228&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2011/12/28/active-directory-users-and-computers-mmc-snapin-for-windows-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Sharepoint list view threshold and working with large lists reference</title>
		<link>http://mundeep.wordpress.com/2011/11/03/sharepoint-list-view-threshold-and-working-with-large-lists-reference/</link>
		<comments>http://mundeep.wordpress.com/2011/11/03/sharepoint-list-view-threshold-and-working-with-large-lists-reference/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 12:05:17 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=199</guid>
		<description><![CDATA[A common error to come across in Sharepoint 2010 when dealing with large lists is: The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator. The following blog articles have a good explanation on how the thresholds work in Sharepoint 2010. Sharepoint 2010 List Throttling Understanding List Query Throttling [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=199&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A common error to come across in Sharepoint 2010 when dealing with large lists is:</p>
<blockquote><p>The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.</p></blockquote>
<p>The following blog articles have a good explanation on how the thresholds work in Sharepoint 2010.</p>
<ul>
<li><a href="http://blogs.technet.com/b/speschka/archive/2009/10/27/working-with-large-lists-in-sharepoint-2010-list-throttling.aspx">Sharepoint 2010 List Throttling</a></li>
<li><a href="http://jrjlee.blogspot.com/2011/02/understanding-list-query-throttling.html">Understanding List Query Throttling</a></li>
<li><a href="http://jrjlee.blogspot.com/2011/03/sharepoint-2010-query-thresholds-bite.html">Sharepoint 2010 Query Thresholds</a></li>
<li><a href="http://www.akshaykoul.com/blog/Home/tabid/40/EntryId/11/Throttling-Best-Practices.aspx">Sharepoint List Throttling Best Practices</a></li>
<li><a href="http://blogs.msdn.com/b/dinaayoub/archive/2010/04/27/programmatically-using-the-object-model-override-for-the-list-view-threshold.aspx">Using Web Application Policy to Override the Threshold</a></li>
<li><a href="http://www.glynblogs.com/2011/03/sharepoint-2010-list-view-throttling-and-custom-caml-queries.html">List View Throttling and Custom CAML Queries</a>
</ul>
<p>Microsoft also has some official guidance on managing large lists:</p>
<ul>
<li><a href="http://office.microsoft.com/en-us/sharepoint-server-help/sharepoint-lists-v-techniques-for-managing-large-lists-RZ101874361.aspx">Microsoft Tutorial with Techniques for Managing Large Lists</a></li>
<li><a href="http://office.microsoft.com/en-us/sharepoint-server-help/quick-reference-card-RZ101874361.aspx?section=11">Quick Reference Card (provided from the Microsoft Tuorial)</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/ff798465.aspx">Patterns &amp; Practices guidance on Query Throttling and Indexing</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=199&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2011/11/03/sharepoint-list-view-threshold-and-working-with-large-lists-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Attaching to the right process when debugging</title>
		<link>http://mundeep.wordpress.com/2011/08/18/attaching-to-the-right-process-when-debugging/</link>
		<comments>http://mundeep.wordpress.com/2011/08/18/attaching-to-the-right-process-when-debugging/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 14:31:03 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[application pool]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[iis]]></category>
		<category><![CDATA[process]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=175</guid>
		<description><![CDATA[A common problem when trying to debug an ASP.NET web application (including SharePoint based solutions) is determining which w3wp.exe process to attach to. Thankfully there are a couple of commands to help out. If using IIS7: c:\Windows\System32\inetsrv\appcmd list wp If using IIS6: cscript c:\WINDOWS\system32\iisapp.vbs Source: http://stackoverflow.com/questions/748927/iis-application-pool-pid<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=175&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A common problem when trying to debug an ASP.NET web application (including SharePoint based solutions) is determining which w3wp.exe process to attach to. Thankfully there are a couple of commands to help out.</p>
<p>If using IIS7:<br />
c:\Windows\System32\inetsrv\appcmd list wp</p>
<p>If using IIS6:<br />
cscript c:\WINDOWS\system32\iisapp.vbs</p>
<p>Source: <a href="http://stackoverflow.com/questions/748927/iis-application-pool-pid" title="Determine IIS Application Pool PID">http://stackoverflow.com/questions/748927/iis-application-pool-pid</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=175&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2011/08/18/attaching-to-the-right-process-when-debugging/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Sharepoint 2010 Remote Debugging</title>
		<link>http://mundeep.wordpress.com/2011/08/05/sharepoint-remote-debugging/</link>
		<comments>http://mundeep.wordpress.com/2011/08/05/sharepoint-remote-debugging/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 18:04:20 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[remote debugging]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=160</guid>
		<description><![CDATA[The following is a realy good article about Remote Debugging Sharepoint 2010 webparts and worth a read if you are ever having trouble getting it working: http://lemonharpy.wordpress.com/2011/03/17/remote-debugging-sharepoint-2010-solutions/ Essentially the main things to ensure are: You are running Visual Sudio Remote Debugger (msvsmon.exe) You are using an account with permissions to debug. You have placed the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=160&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following is a realy good article about Remote Debugging Sharepoint 2010 webparts and worth a read if you are ever having trouble getting it working:<br />
<a href="http://lemonharpy.wordpress.com/2011/03/17/remote-debugging-sharepoint-2010-solutions/" title="http://lemonharpy.wordpress.com/2011/03/17/remote-debugging-sharepoint-2010-solutions/">http://lemonharpy.wordpress.com/2011/03/17/remote-debugging-sharepoint-2010-solutions/</a></p>
<p>Essentially the main things to ensure are:</p>
<ol>
<li>You are running Visual Sudio Remote Debugger (msvsmon.exe)</li>
<li>You are using an account with permissions to debug.</li>
<li>You have placed the pdb files in the approriate folder (usually in GAC)</li>
<li>The version of code running on the remote server is exactly the same as in the Visual Studio project you have opened (If possible it is always good to perform  fresh build and deployment before trying to debug.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=160&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2011/08/05/sharepoint-remote-debugging/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>c# if else alternative syntax using ? : operator</title>
		<link>http://mundeep.wordpress.com/2011/07/15/c-if-else-alternative-syntax-using-operator/</link>
		<comments>http://mundeep.wordpress.com/2011/07/15/c-if-else-alternative-syntax-using-operator/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 10:42:17 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=141</guid>
		<description><![CDATA[One of the c# operators i tend to use a lot is the ?: operator which is essentially an alternative syntax to an if else statement. Unfortunately i often forget the order of the statements so am adding this quick post as a note for myself to easily remember Essentially: Is equivalent to: References: MSDN [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=141&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of the c# operators i tend to use a lot is the ?: operator which is essentially an alternative syntax to an if else statement. Unfortunately i often forget the order of the statements so am adding this quick post as a note for myself to easily remember <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Essentially:<br />
<pre class="brush: csharp;">condition ? first_expression : second_expression;</pre></p>
<p>Is equivalent to:<br />
<pre class="brush: csharp;">if (condition) {
 first_expression;
}
else {
 second_expression;
}
</pre></p>
<p>References:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/ty67wk28%28v=vs.80%29.aspx" title="MSDN ?: Operator">MSDN ?: Operator</a>
</li>
<li>Also checkout <a href="http://msdn.microsoft.com/en-us/library/6a71f45d.aspx">Other C# Operators</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=141&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2011/07/15/c-if-else-alternative-syntax-using-operator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Powershell Script to Import Sharepoint Organization Profiles from Active Directory</title>
		<link>http://mundeep.wordpress.com/2010/11/08/powershell-script-to-import-sharepoint-organization-profiles-from-active-directory/</link>
		<comments>http://mundeep.wordpress.com/2010/11/08/powershell-script-to-import-sharepoint-organization-profiles-from-active-directory/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 01:07:39 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[organizational profiles]]></category>
		<category><![CDATA[sharpeoint 2010]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=114</guid>
		<description><![CDATA[Here is one of my first Powershell scripts (so improvement suggestions welcome The requirement was to script the creation of SharePoint Organization Profiles from Active Directory Organizational Units, including building the hierarchy and setting the Profile Subtype appropriately. Creation of the Organizational Profiles was based on the C# code in the How to: Create User [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=114&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is one of my first Powershell scripts (so improvement suggestions welcome <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The requirement was to script the creation of SharePoint Organization Profiles from Active Directory Organizational Units, including building the hierarchy and setting the Profile Subtype appropriately. Creation of the Organizational Profiles was based on the C# code in the <a href="http://msdn.microsoft.com/en-us/library/ms545122.aspx">How to: Create User Profiles and Organization Profiles</a> MSDN article.</p>
<p>Before running this note that i had a predefined list of profile subtypes that corresponded to the level of the organizational unit in the hierarchy. The top level was Root, next level was Group, then Division, Branch &amp; finally Section. The following is an example of the organizational structure in terms of Profile Subtypes.</p>
<ul>
<li>Department (Root Level)
<ul>
<li>Group #1
<ul>
<li>Division #1
<ul>
<li>Branch #1
<ul>
<li>Section #1</li>
</ul>
</li>
</ul>
</li>
<li> Division #2
<ul>
<li> Branch #2
<ul>
<li>Section #2</li>
<li>Section #3</li>
<li>Section #4</li>
</ul>
</li>
<li>Branch #3
<ul>
<li>Section #5</li>
<li>Section #6</li>
</ul>
</li>
</ul>
</li>
<li>Division #4
<ul>
<li>Branch #7</li>
</ul>
</li>
</ul>
</li>
<li>Group #2
<ul>
<li>Division #5
<ul>
<li>Branch #8
<ul>
<li>Section #9</li>
</ul>
</li>
</ul>
</li>
<li> Division #6
<ul>
<li> Branch #9
<ul>
<li>Section #10</li>
<li>Section #11</li>
<li>Section #12</li>
</ul>
</li>
</ul>
</li>
<li>Division #6
<ul>
<li>Branch #9</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p><pre class="brush: powershell;">
#Create All Organisation Profiles from AD OU's
#Load Sharepoint Snapin
Add-PSSnapin Microsoft.SharePoint.PowerShell
#Declare Some Globals for Profile Management
$context = Get-SPServiceContext -Site http://{sharepointwebappurl}/
$psm = [Microsoft.Office.Server.UserProfiles.ProfileSubtypeManager]::Get($context);
$opm = New-Object Microsoft.Office.Server.UserProfiles.OrganizationProfileManager($context)
$rootOrg = $opm.RootOrganization

#Find All Children OU's Based on Parent OU's Distinguished Name (DN)
function Find-Child-OUs
{
Param ([string]$sParentDN)
	$ldapPath = &quot;LDAP://&quot; + $sParentDN
	$query = new-object system.directoryservices.directorysearcher([ADSI]$ldapPath)
	#Only Search for OUs
	$query.filter = &quot;(objectClass=organizationalUnit)&quot;
	#Only Search One Level Deep (ie. Children)
	$query.SearchScope = &quot;OneLevel&quot;
	$results = $query.findAll()
	Write-Host $sParentDN &quot; has &quot; $results.Count &quot; children&quot;
	return $results
}

#Create an Organization Profile under parentOrg for provided OU
function Create-Organization {
Param ($ou, $parentOrg, $levelTitle)
	Write-Host &quot;Creating:&quot; $ou.description &quot;under&quot; $parentOrg.DisplayName &quot;of type&quot; $levelTitle
	$subType = $psm.GetProfileSubtype($levelTitle);
	$orgProfile = $opm.CreateOrganizationProfile($subType, $parentOrg)
	$orgProfile.DisplayName = $ou.description
	$orgProfile.Commit()
	return $orgProfile
}

#Determine Subtype Based on Level
function Get-Level-ProfileSubtype {
Param ($level)
	$subtypeTitle = $level
	switch ($level) {
		0 { $subtypeTitle = &quot;Root&quot;; break }
		1 { $subtypeTitle = &quot;Group&quot;; break }
		2 { $subtypeTitle = &quot;Division&quot;; break }
		3 { $subtypeTitle = &quot;Branch&quot;; break }
		4 { $subtypeTitle = &quot;Section&quot;; break }
		default { $subtypeTitle = &quot;Other&quot; }
	}
	return $subtypeTitle
}

#Create Organization Profiles for All OU's underneath the provided OU and Organization Profile
function Create-Child-Orgnizations
{
Param ([string]$currentOuDn, $parentOrg, $level)
	#Create the Organization
	Write-Host &quot;Searching for Children for: &quot; $currentOuDn
	$children = Find-Child-OUs $currentOuDn
	if ($children -ne $null) {
		Write-Host -ForegroundColor red $children.Count &quot;OU's found under:&quot; $currentOuDn
		Foreach($childOu in $children)
		{
			$ou = $childOu.GetDirectoryEntry()
			$ouDn = $ou.distinguishedname
			$levelTitle = Get-Level-ProfileSubtype($level)

			#Create the Child Organization
			$newOrg = Create-Organization $ou $parentOrg $levelTitle
			Write-Host -ForegroundColor green &quot;OU Created: &quot; $newOrg.DisplayName &quot; = &quot; $newOrg.ProfileSubtype.Name
			$nextLevel = $level + 1
			Create-Child-Orgnizations $ouDn $newOrg $nextLevel
		}
	}
}

#Create All Organization Profiles Starting from Provided OU DN
function Create-All-Organizations {
Param ([string]$rootOuDn)
	Create-Child-Orgnizations $rootOuDn $rootOrg 1
}
</pre></p>
<p>Once you have loaded all the globals and declared all the functions above the following two lines (can be done in one) will begin the profile creation.</p>
<p><pre class="brush: powershell;">
#Run Creation From Root Orgnization Unit, Make sure the following matches the LDAP query to the Root OU in your AD structure.
$rootOu = &quot;OU=Department,DC=depttest,DC=gov,DC=au&quot;
Create-All-Organizations $rootOu
</pre></p>
<p>To help with testing &amp; re-running code i also created a couple of functions to (a) List all Organizational Profiles under a parent and (b) Delete all Organization Profiles under a parent.</p>
<p><pre class="brush: powershell;">
#Retrieve existing Org Profiles
function List-OrgProfiles {
Param($parentOrg)
	if ($parentOrg.HasChildren) {
		foreach ($childOrg in $parentOrg.GetChildren()) {
			Write-Host $parentOrg.DisplayName &quot;-&quot; $childOrg.DisplayName
			List-OrgProfiles $childOrg
		}
	}
}

#Delete existing Org Profiles
function Delete-OrgProfiles {
Param($parentOrg)
	# If Parent Has Children Delete them first
	if ($parentOrg.HasChildren) {
		foreach ($childOrg in $parentOrg.GetChildren()) {
			#Write-Host $childOrg.DisplayName &quot; - &quot; $parentOrg.DisplayName
			Delete-OrgProfiles $childOrg
		}
		#Once children are deleted remove the current org
		if ($parentOrg.RecordId -ne $opm.RootOrganization.RecordId) {
			$opm.RemoveOrganizationProfile($parentOrg.RecordId)
			Write-Host &quot;Removing(&quot; $parentOrg.DisplayName &quot;)&quot;
		}
		else {
			Write-Host &quot;KEEP (&quot; $parentOrg.DisplayName &quot;)&quot;
		}
	}
	else {
		#If not children then delete the current org
		if ($parentOrg.RecordId -ne $opm.RootOrganization.RecordId) {
			$opm.RemoveOrganizationProfile($parentOrg.RecordId)
			Write-Host &quot;RemovingChildless(&quot; $parentOrg.DisplayName &quot;)&quot;
		}
		else {
			Write-Host &quot;Childless KEEP(&quot; $parentOrg.DisplayName &quot;)&quot;
		}
	}
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=114&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2010/11/08/powershell-script-to-import-sharepoint-organization-profiles-from-active-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Bug in Editing Sharepoint Organization Profiles</title>
		<link>http://mundeep.wordpress.com/2010/10/27/bug-in-editing-sharepoint-organization-profiles/</link>
		<comments>http://mundeep.wordpress.com/2010/10/27/bug-in-editing-sharepoint-organization-profiles/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 13:48:11 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=109</guid>
		<description><![CDATA[There appears to be a bug in editing Sharepoint 2010 Organization Profiles. If you try to edit the Profile SubType without editing any other field your change is not saved. The work around is to update any other field at the same time (and then don&#8217;t forget to change that field back). Refer to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=109&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There appears to be a bug in editing Sharepoint 2010 Organization Profiles. If you try to edit the Profile SubType without editing any other field your change is not saved. The work around is to update any other field at the same time (and then don&#8217;t forget to change that field back).</p>
<p>Refer to the comments on MSDN <a href="http://msdn.microsoft.com/en-us/library/ms545122.aspx">http://msdn.microsoft.com/en-us/library/ms545122.aspx</a> for an example on how to do this in code.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=109&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2010/10/27/bug-in-editing-sharepoint-organization-profiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Sharepoint 2007 Calculated Fields</title>
		<link>http://mundeep.wordpress.com/2010/10/27/sharepoint-2007-calculated-fields/</link>
		<comments>http://mundeep.wordpress.com/2010/10/27/sharepoint-2007-calculated-fields/#comments</comments>
		<pubDate>Wed, 27 Oct 2010 13:36:13 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=73</guid>
		<description><![CDATA[This is just a quick brain dump of some research into Calculated Field formulas for MOSS that i&#8217;ve had sitting as a Draft for a while. The most official resource appears to be: http://office.microsoft.com/en-us/sharepointtechnology/HA011609471033.aspx Which i discovered via: http://www.devcow.com/blogs/jdattis/archive/2007/07/30/6719.aspx Unfortunately it doesn&#8217;t appear to be complete, for example it is missing the ISBLANK function. There [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=73&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is just a quick brain dump of some research into Calculated Field formulas for MOSS that i&#8217;ve had sitting as a Draft for a while.</p>
<ul>
<li>The most official resource appears to be:<br /> <a href="http://office.microsoft.com/en-us/sharepointtechnology/HA011609471033.aspx">http://office.microsoft.com/en-us/sharepointtechnology/HA011609471033.aspx</a><br />
Which i discovered via:<br /> <a href="http://www.devcow.com/blogs/jdattis/archive/2007/07/30/6719.aspx">http://www.devcow.com/blogs/jdattis/archive/2007/07/30/6719.aspx</a><br />
Unfortunately it doesn&#8217;t appear to be complete, for example it is missing the ISBLANK function.</li>
<li>There is also an MSDN Reference:<br />
<a href="http://msdn.microsoft.com/en-us/library/bb862071%28office.12%29.aspx">http://msdn.microsoft.com/en-us/library/bb862071%28office.12%29.aspx</a></li>
<li> An interesting guide on testing forumlas using Excel:<br />
<a href="http://techtrainingnotes.blogspot.com/2010/08/sharepoint-creating-calculated-column.html">http://techtrainingnotes.blogspot.com/2010/08/sharepoint-creating-calculated-column.html</a></li>
</ul>
<p><font color='red'><strong>UPDATE:</strong> This appears to be the most comprehensive offical guide on Formulas and Functions that can be used:</font><br />
<a href="http://office.microsoft.com/en-us/windows-sharepoint-services-help/CH010065006.aspx">http://office.microsoft.com/en-us/windows-sharepoint-services-help/CH010065006.aspx</a></ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=73&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2010/10/27/sharepoint-2007-calculated-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Updating the Created Date of a Document or List Item Programmatically</title>
		<link>http://mundeep.wordpress.com/2009/05/22/updating-the-created-date-of-a-document/</link>
		<comments>http://mundeep.wordpress.com/2009/05/22/updating-the-created-date-of-a-document/#comments</comments>
		<pubDate>Fri, 22 May 2009 01:39:57 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=71</guid>
		<description><![CDATA[A common tasks developers are required to do with Sharepoint is migrated documents from either legacy systems or older Sharepoint sites into a document library. There are many ways to do this documented out there (most commonly using the Files.Add method of the API), but one of the common requirements during this &#8216;migration&#8217; is to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=71&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A common tasks developers are required to do with Sharepoint is migrated documents from either legacy systems or older Sharepoint sites into a document library. There are many ways to do this documented out there (most commonly using the <a href="http://msdn.microsoft.com/en-us/library/ms454491.aspx">Files.Add</a> method of the API), but one of the common requirements during this &#8216;migration&#8217; is to retain the Created Date or Created By fields. <a href="http://blogs.msdn.com/sowmyancs/">Sowmyan&#8217;s blog</a> has a good description of how to set the Created By/Modified By user fields <a href="http://blogs.msdn.com/sowmyancs/archive/2008/03/14/can-we-update-the-values-of-created-by-modified-by-columns-in-sharepoint-lists.aspx">here</a>.</p>
<p>Updating the Created Date of a document or list item in Sharepoint is even easier, simply set the &#8220;Created&#8221; field of the item to the value you wish to set. For example if using the <a href="http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?ID=109">Files.Add methods in the API</a> (as described by <a href="http://www.davehunter.co.uk">Dave Hunter</a>) then the following code snippet will update the Created Date:</p>
<p><pre class="brush: csharp;">
// add the file   
SPFile file = docLib.RootFolder.Files.Add(newFileName, inputStream);   
// get the list item for that file   
SPItem item = file.Item;   
//Set the Created Date
item[&quot;Created&quot;] = &quot;2009-02-26 15:00:00&quot;;
item.Update();
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=71&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2009/05/22/updating-the-created-date-of-a-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>InfoPath 2007 Custom Field Validation (Programmatic)</title>
		<link>http://mundeep.wordpress.com/2009/05/20/infopath-2007-custom-field-validation/</link>
		<comments>http://mundeep.wordpress.com/2009/05/20/infopath-2007-custom-field-validation/#comments</comments>
		<pubDate>Tue, 19 May 2009 14:22:40 +0000</pubDate>
		<dc:creator>mundeep</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[visual studio tools for applications]]></category>

		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=39</guid>
		<description><![CDATA[Adding custom (programmatic) field validation to a form in InfoPath 2007 is quite easy. Firstly make sure you have set your programming language of choice by going to the Tools menu then &#8220;Form Options&#8221; -&#62; &#8220;Programming&#8221;, and then selecting your preferred language under &#8220;Form template code language&#8221;. For this example i am going to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=39&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Adding custom (programmatic) field validation to a form in InfoPath 2007 is quite easy. Firstly make sure you have set your programming language of choice by going to the Tools menu then &#8220;Form Options&#8221; -&gt; &#8220;Programming&#8221;, and then selecting your preferred language under &#8220;Form template code language&#8221;. For this example i am going to be using C#.</p>
<p>Back in your form design window right-click on the field you wish to validate, and select &#8220;Programming&#8221; -&gt; &#8220;Validating Event&#8221;. This will open a &#8220;Visual Studio Tools for Applications&#8221; (<a href="http://blogs.msdn.com/vsta/">VSTA</a>) window, and generate the following code snippet:<br />
<pre class="brush: csharp;">
        public void myFieldName_Validating(object sender, XmlValidatingEventArgs e)
        {
            // Write your code here.
        }
</pre></p>
<p>Obviously this code is not doing any validation yet, we just need to insert our validation code in place of the &#8220;your code here&#8221; comment. Let us try a simple validation of ensure the data entered in the field is at least 3 characters long with the following code.<br />
<pre class="brush: csharp;">
public void myFieldName_Validating(object sender, XmlValidatingEventArgs e) {
    //Check the Length of the NewValue of the field
    if (e.NewValue.Length &lt; 3) {
        //Report the validation error back to the client on the form
        e.ReportError(e.Site, false, &quot;Please Enter a valid MyField&quot;);
    }
}
</pre></p>
<p>As mentioned in the comments e.NewValue retrieves the &#8216;New&#8217; value that is being entered/inserted into the field before it has been set and e.ReportError sends any validation errors back to the form for the client (read the <a href="http://msdn.microsoft.com/en-us/library/aa944759.aspx">MSDN article</a> for details on the parameters of ReportError).</p>
<p>Unfortunately there is a minor issue with this basic piece of code and that is due to the fact that the validating event also gets fired during the loading of the form and as shown in <a href="http://support.microsoft.com/kb/822032">this kb article</a> we need to check the XmlOperation that is being performed when the validation is fired. This means updating our code to the following.</p>
<p><pre class="brush: csharp;">
public void myFieldName_Validating(object sender, XmlValidatingEventArgs e)  {
    //Ensure validation is only done when inserting or changing a value
     if (e.Operation == XmlOperation.Insert || e.Operation == XmlOperation.ValueChange) {
        //Check the Length of the NewValue of the field
        if (e.NewValue.Length &lt; 3) {
            //Report the validation error back to the client on the form
            e.ReportError(e.Site, false, &quot;Please Enter a valid MyField&quot;);
        }
    }
}
</pre></p>
<p>Save your code changes and while still in VSTA build the project to ensure you don&#8217;t have any coding errors (Ctrl+Shift+B, or from the menu &#8220;Build&#8221; -&gt; &#8220;Build &#8216;MyFormName&#8217;&#8221;). If you get a &#8220;Build succeeded&#8221; message in the status bar you can close the VSTA window and then preview your form to see your validation in action.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mundeep.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mundeep.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mundeep.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mundeep.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mundeep.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mundeep.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mundeep.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mundeep.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mundeep.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mundeep.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mundeep.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mundeep.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mundeep.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mundeep.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mundeep.wordpress.com&amp;blog=1630736&amp;post=39&amp;subd=mundeep&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mundeep.wordpress.com/2009/05/20/infopath-2007-custom-field-validation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
	</channel>
</rss>
