<?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="https://mundeep.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://mundeep.wordpress.com</link>
	<description>Mundeep&#039;s Tech Blog</description>
	<lastBuildDate>Mon, 12 Aug 2013 03:24:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<site xmlns="com-wordpress:feed-additions:1">1630736</site><cloud domain='mundeep.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s0.wp.com/i/buttonw-com.png</url>
		<title>Point Deep</title>
		<link>https://mundeep.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://mundeep.wordpress.com/osd.xml" title="Point Deep" />
	<atom:link rel='hub' href='https://mundeep.wordpress.com/?pushpress=hub'/>
	<item>
		<title>Default Download Location for Windows 8 Software Center</title>
		<link>https://mundeep.wordpress.com/2013/08/12/default-download-location-for-windows-8-software-center/</link>
					<comments>https://mundeep.wordpress.com/2013/08/12/default-download-location-for-windows-8-software-center/#respond</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Mon, 12 Aug 2013 03:24:12 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=260</guid>

					<description><![CDATA[Curious about where Windows 8 Software Center (part of Microsoft System Center 2012) caches it&#8217;s downloads? I wanted to know where the downloads where cached so i wouldn&#8217;t have to re-download them if required to re-run later down the track. Run the following Powershell command to find out: In my case it was: C:\Windows\ccmcache which [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Curious about where Windows 8 Software Center (part of Microsoft System Center 2012) caches it&#8217;s downloads?<br />
I wanted to know where the downloads where cached so i wouldn&#8217;t have to re-download them if required to re-run later down the track.</p>
<p>Run the following Powershell command to find out:</p>
<pre class="brush: powershell; title: ; notranslate">$Cache = gwmi -class CacheConfig -Namespace root\ccm\SoftMgmtAgent
$Cache.Location</pre>
<p>In my case it was: <em>C:\Windows\ccmcache</em> which i imagine may be a default.</p>
<p>Thanks to David O&#8217;Briens <a title="How to configure the ConfigMgr Client cache" href="http://www.david-obrien.net/2013/02/07/how-to-configure-the-configmgr-client/">How to configure the ConfigMgr Client cache</a> article for helping me find this. The article also details how you can change it and some warnings if you do.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2013/08/12/default-download-location-for-windows-8-software-center/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">260</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Clearing Timer Services</title>
		<link>https://mundeep.wordpress.com/2012/08/13/clearing-timer-services/</link>
					<comments>https://mundeep.wordpress.com/2012/08/13/clearing-timer-services/#comments</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Mon, 13 Aug 2012 14:21:43 +0000</pubDate>
				<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[health analyzer]]></category>
		<category><![CDATA[sharepoint timer service]]></category>
		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=254</guid>

					<description><![CDATA[Problem The following error appears in (a) Event Viewer &#38; (b) Health Analyzer as a critical item: The SharePoint Health Analyzer detected an error. One or more services have started or stopped unexpectedly. The following services are managed by SharePoint, but their running state does not match what SharePoint expects: SPAdminV4. This can happen if [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Problem</strong><br />
The following error appears in (a) Event Viewer &amp; (b) Health Analyzer as a critical item:</p>
<blockquote><p>The SharePoint Health Analyzer detected an error.  One or more services have started or stopped unexpectedly.<br />
The following services are managed by SharePoint, but their running state does not match what SharePoint expects: SPAdminV4.  This can happen if a service crashes or if an administrator starts or stops a service using a non-SharePoint interface.  If SharePoint-managed services do not match their expected running state, SharePoint will be unable to correctly distribute work to the service.<br />
SharePoint was unable to automatically repair this error.</p>
<p>To stop or start a service managed by SharePoint, use the SharePoint service management interface in the SharePoint Central Administration Site.  If a service has crashed, restart the service manually on the affected servers by running &#8220;net start [service name]&#8221; from a command prompt. For more information about this rule, see &#8220;<a href="http://go.microsoft.com/fwlink/?LinkID=142683&#038;#8221" rel="nofollow">http://go.microsoft.com/fwlink/?LinkID=142683&#038;#8221</a>;.
</p></blockquote>
<p>I checked the server to ensure the SharePoint Timer Service was running (even restarted it) but that didn&#8217;t help so I tried to run the SharePoint Configuration Wizard on the box that CA could not see the Timer Service on. It gave me the following error:</p>
<blockquote><p>08/13/2012 14:57:46  11  ERR                      Exception: Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException: An update conflict has occurred, and you must re-try this action. The object AnalysisServicesDiagnostics was updated by DOMAIN\SP2010SetupUser, in the psconfigui (1608) process, on machine CENTRALADMINSERVERNAME.  View the tracing log for more information about the conflict.<br />
   at Microsoft.SharePoint.Administration.SPConfigurationDatabase.StoreObject(SPPersistedObject obj, Boolean storeClassIfNecessary, Boolean ensure)<br />
   at Microsoft.SharePoint.Administration.SPConfigurationDatabase.Microsoft.SharePoint.Administration.ISPPersistedStoreProvider.PutObject(SPPersistedObject persistedObject, Boolean ensure)<br />
   at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate()<br />
   at Microsoft.SharePoint.Administration.SPDiagnosticsServiceBase.Update()<br />
   at Microsoft.SharePoint.Administration.SPDiagnosticsService.Update()<br />
   at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InstallServiceInConfigDB(Boolean provisionTheServiceToo, String serviceRegistryKeyName)<br />
   at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.InstallServices(Boolean provisionTheServicesToo)<br />
   at Microsoft.SharePoint.PostSetupConfiguration.ServicesTask.Run()<br />
   at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()
</p></blockquote>
<p><strong>Resolution</strong><br />
Apparently this is caused by the timer job cache being in an inconsistent state (in my<br />
case due to server restore from a snapshot). </p>
<p><a href="http://blog.christophermichaelwebb.com/windows/clear-the-sharepoint-configuration-timer-cache/348/">Clearing the timer job cache</a> solved the issue.</p>
<p>Summary of the steps to clear the timer job:</p>
<li>Stop SharePoint Timer service on all servers in the farm.</li>
<li>Browse to C:\ProgramData\Microsoft\SharePoint\Config\{GUID} where the {GUID} folder contains a bunch of XML files and NOT the files with a &#8220;.PERSITEDFILE&#8221; extension.</li>
<li>Delete all the XML files</li>
<li>Update the contents of the Cache.ini file to just say &#8220;1&#8221; (without quotes).</li>
<li>Restart the SharePoint Timer service on each server</li>
<li>Reanalyze the isse in Health Analyzer</li>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2012/08/13/clearing-timer-services/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">254</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Calling powershell functions with multiple parameters</title>
		<link>https://mundeep.wordpress.com/2012/03/01/calling-powershell-functions-with-multiple-parameters/</link>
					<comments>https://mundeep.wordpress.com/2012/03/01/calling-powershell-functions-with-multiple-parameters/#comments</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Thu, 01 Mar 2012 11:35:24 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">http://mundeep.wordpress.com/?p=236</guid>

					<description><![CDATA[When calling a powershell function with multiple parameters, ensure the parameters are passed in space separated and not comma-separated as the later causes all the values to be passed in as an array to the first parameter! See Stackoverflow: Powershell Multiple Function Parameters for an example.]]></description>
										<content:encoded><![CDATA[<p>When calling a powershell function with multiple parameters, ensure the parameters are passed in space separated and not comma-separated as the later causes all the values to be passed in as an array to the first parameter!</p>
<p>See <a href="http://stackoverflow.com/questions/4988226/powershell-multiple-function-parameters" title="Stackoverflow: Powershell Multiple Function Parameters">Stackoverflow: Powershell Multiple Function Parameters</a> for an example.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2012/03/01/calling-powershell-functions-with-multiple-parameters/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">236</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Active Directory Users and Computers MMC Snapin for Windows 2008</title>
		<link>https://mundeep.wordpress.com/2011/12/28/active-directory-users-and-computers-mmc-snapin-for-windows-2008/</link>
					<comments>https://mundeep.wordpress.com/2011/12/28/active-directory-users-and-computers-mmc-snapin-for-windows-2008/#respond</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Wed, 28 Dec 2011 10:17:46 +0000</pubDate>
				<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: [&#8230;]]]></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>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2011/12/28/active-directory-users-and-computers-mmc-snapin-for-windows-2008/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">228</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" 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>https://mundeep.wordpress.com/2011/11/03/sharepoint-list-view-threshold-and-working-with-large-lists-reference/</link>
					<comments>https://mundeep.wordpress.com/2011/11/03/sharepoint-list-view-threshold-and-working-with-large-lists-reference/#respond</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Thu, 03 Nov 2011 12:05:17 +0000</pubDate>
				<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 [&#8230;]]]></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>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2011/11/03/sharepoint-list-view-threshold-and-working-with-large-lists-reference/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">199</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Attaching to the right process when debugging</title>
		<link>https://mundeep.wordpress.com/2011/08/18/attaching-to-the-right-process-when-debugging/</link>
					<comments>https://mundeep.wordpress.com/2011/08/18/attaching-to-the-right-process-when-debugging/#comments</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Thu, 18 Aug 2011 14:31:03 +0000</pubDate>
				<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]]></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>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2011/08/18/attaching-to-the-right-process-when-debugging/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">175</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Sharepoint 2010 Remote Debugging</title>
		<link>https://mundeep.wordpress.com/2011/08/05/sharepoint-remote-debugging/</link>
					<comments>https://mundeep.wordpress.com/2011/08/05/sharepoint-remote-debugging/#comments</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Fri, 05 Aug 2011 18:04:20 +0000</pubDate>
				<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 [&#8230;]]]></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>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2011/08/05/sharepoint-remote-debugging/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">160</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>c# if else alternative syntax using ? : operator</title>
		<link>https://mundeep.wordpress.com/2011/07/15/c-if-else-alternative-syntax-using-operator/</link>
					<comments>https://mundeep.wordpress.com/2011/07/15/c-if-else-alternative-syntax-using-operator/#comments</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Fri, 15 Jul 2011 10:42:17 +0000</pubDate>
				<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: [&#8230;]]]></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="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Essentially:</p>
<pre class="brush: csharp; title: ; notranslate">condition ? first_expression : second_expression;</pre>
<p>Is equivalent to:</p>
<pre class="brush: csharp; title: ; notranslate">if (condition) {
 first_expression;
}
else {
 second_expression;
}
</pre>
<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>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2011/07/15/c-if-else-alternative-syntax-using-operator/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">141</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" 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>https://mundeep.wordpress.com/2010/11/08/powershell-script-to-import-sharepoint-organization-profiles-from-active-directory/</link>
					<comments>https://mundeep.wordpress.com/2010/11/08/powershell-script-to-import-sharepoint-organization-profiles-from-active-directory/#respond</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Mon, 08 Nov 2010 01:07:39 +0000</pubDate>
				<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 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Here is one of my first Powershell scripts (so improvement suggestions welcome <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></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>
<pre class="brush: powershell; title: ; notranslate">
#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>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>
<pre class="brush: powershell; title: ; notranslate">
#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>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>
<pre class="brush: powershell; title: ; notranslate">
#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>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2010/11/08/powershell-script-to-import-sharepoint-organization-profiles-from-active-directory/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">114</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Bug in Editing Sharepoint Organization Profiles</title>
		<link>https://mundeep.wordpress.com/2010/10/27/bug-in-editing-sharepoint-organization-profiles/</link>
					<comments>https://mundeep.wordpress.com/2010/10/27/bug-in-editing-sharepoint-organization-profiles/#respond</comments>
		
		<dc:creator><![CDATA[mundeep]]></dc:creator>
		<pubDate>Wed, 27 Oct 2010 13:48:11 +0000</pubDate>
				<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 [&#8230;]]]></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>
]]></content:encoded>
					
					<wfw:commentRss>https://mundeep.wordpress.com/2010/10/27/bug-in-editing-sharepoint-organization-profiles/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">109</post-id>
		<media:content url="https://0.gravatar.com/avatar/c51cd8b5b7d22a6b84ad0529540b90facac3cfdd87002fbd5ad72f8827b1c9b3?s=96&#38;d=https%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">mundeep</media:title>
		</media:content>
	</item>
	</channel>
</rss>
