<?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>Ideas For Free &#187; Tips and Tricks</title>
	<atom:link href="http://blog.libinuko.com/category/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.libinuko.com</link>
	<description>Only freedom will grow our ideas</description>
	<lastBuildDate>Sun, 18 Dec 2011 04:51:16 +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>SharePoint 2010: RemoteStsAdm PowerShell Module is available via NuGet</title>
		<link>http://blog.libinuko.com/2011/12/18/sharepoint-2010-remotestsadm-powershell-module-is-available-via-nuget/</link>
		<comments>http://blog.libinuko.com/2011/12/18/sharepoint-2010-remotestsadm-powershell-module-is-available-via-nuget/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 04:15:43 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[Community Content]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[NuGet]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/?p=716</guid>
		<description><![CDATA[English: Few month ago I have introduced RemoteStsAdm, a PowerShell module that enable you to execute StsAdm.exe remotely. StsAdm.exe is a command line administration tools for SharePoint. Unfortunately to run StsAdm, one must log-in to SharePoint server member &#8211; since the tool can not be executed remotely. RemoteStsAdm is to answer this problem, allowing admin to [...] <a href="http://blog.libinuko.com/2011/12/18/sharepoint-2010-remotestsadm-powershell-module-is-available-via-nuget/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>English:</p>
<p>Few month ago I have introduced RemoteStsAdm, a PowerShell module that enable you to execute StsAdm.exe remotely. StsAdm.exe is a command line administration tools for SharePoint. Unfortunately to run StsAdm, one must log-in to SharePoint server member &ndash; since the tool can not be executed remotely. RemoteStsAdm is to answer this problem, allowing admin to execute StsAdm remotely. You can download the source code from <a href="http://code.msdn.microsoft.com/windowsdesktop/Remote-StsAdm-in-6fec24b8">MSDN Galery here</a> or read the <a href="http://blog.libinuko.com/2011/09/17/sharepoint-2010-remotestsadm-powershell-module/">original article in previous post here</a>.&nbsp;</p>
<p>Yesterday, I have <a href="http://blog.libinuko.com/2011/12/17/introducing-import-psmodule/">released ImportPSModule</a> that will easy PowerShell module distribution, allow update notification and configuration. The RemoteStsAdm PowerShell module is now available via NuGet, so that you don&rsquo;t need to download and extract manually. All will be done seamlessly, and whenever we got script update &ndash; you will get notified as soon as you open PowerShell session.</p>
<p>So what do you wait for, open PowerShell session and type following:</p>
<div class="wlWriterEditableSmartContent" id="scid:E8C2ABEC-2EDF-4263-8854-38F0AFB6C437:4bb12004-931d-431d-af21-4723eda453ef" style="margin: 0px; padding: 0px; float: none; display: inline;">
<pre class="brush: powershell; title: ; notranslate">Import-PSModule RemoteStsAdm </pre>
</div>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2011/12/18/sharepoint-2010-remotestsadm-powershell-module-is-available-via-nuget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell: Introducing Import-PSModule</title>
		<link>http://blog.libinuko.com/2011/12/17/introducing-import-psmodule/</link>
		<comments>http://blog.libinuko.com/2011/12/17/introducing-import-psmodule/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 11:32:51 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[NuGet]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/?p=704</guid>
		<description><![CDATA[You may already know PsGet&#160;by Chaliy or PsGet by Anurse for PowerShell module distribution. They have created PowerShell module&#160;distribution mechanism with different approach. Chaliy uses PowerShell script approach and customized module directory. Everytime you want to distribute your PowerShell module, you have to fork his github project to update Directory.xml content. Even tough the instruction in [...] <a href="http://blog.libinuko.com/2011/12/17/introducing-import-psmodule/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>You may already know <strong><a href="http://psget.net/">PsGet</a>&nbsp;by Chaliy</strong> or <strong><a href="http://vibrantcode.com/blog/2011/2/16/psget-v02now-with-more-awesome-and-fewer-version-numbers.html">PsGet </a>by Anurse</strong> for PowerShell module distribution. They have created PowerShell module&nbsp;distribution mechanism with different approach.</p>
<p>Chaliy uses PowerShell script approach and customized module directory. Everytime you want to distribute your PowerShell module, you have to fork his github project to update Directory.xml content. Even tough the instruction in <a href="https://github.com/chaliy/psget/wiki/How-to-add-your-module-to-the-directory">https://github.com/chaliy/psget/wiki/How-to-add-your-module-to-the-directory</a>&nbsp;is very clear, however<u> I think there is risk of incorrect Directory.xml modification</u>.</p>
<p>Anurse uses PowerShell manifest approach and standard NuGet package to download and put module in appropriate location. In this case you can create a NuGet package containing PowerShell files and publish it to NuGet repository. Using his module, you will be able to get PowerShell module from NuGet repository right to your console. I like this approach because it uses standard NuGet package and publishing process. However, sometimes<strong> I want to be able to register the new module in my profile</strong>. I also want to ensure that I always use latest PowerShell Module&nbsp;package &#8211; ie. <strong>update local module automatically when there is new module in NuGet repository</strong>.</p>
<p>So then, I started to create Import-PSModule a PowerShell script module that will give you functionalities such as:</p>
<ol>
<li>Importing PS Module from NuGet repository</li>
<li>Load imported module to current session</li>
<li>Register imported module to current user profile or all user profile</li>
<li>Un-register imported module from current user profile or all user profile</li>
<li>Auto-update imported module when user start PowerShell session</li>
</ol>
<p>To start using the module, start PowerShell session and type following</p>
<p>&nbsp;&nbsp;
<pre class="brush: powershell; title: ; notranslate">(new-object Net.WebClient).DownloadString(&amp;quot;http://blog.libinuko.com/wp-content/plugins/download-monitor/download.php?id=1&amp;quot;) | iex </pre>
</p>
<p>The script will perform following actions:</p>
<ol>
<li>Download latest ImportPSModule from central NuGet repository.</li>
<li>Install the package to desired location. If you choose to install in User-Module or Global-Module, all future packages will be installed under Module path. If you choose to install in other folder, then all future package will be installed within installation folder.</li>
<li>Load the ImportPSModule to the memory. It will also&nbsp; download latest NuGet.CommandLine package if you don&#39;t have in your system.</li>
</ol>
<p>So what do you waiting for? Start to install the module and publish your PowerShell module in NuGet repository. But don&#39;t forget TAG &quot;<strong>PSModule</strong>&quot; to your NuGet package.</p>
<p>If you want to validate InstallPSModule.ps1, please click here <a class="downloadlink" href="http://blog.libinuko.com/wp-content/plugins/download-monitor/download.php?id=1" title="Version1.0.0 downloaded 115 times" >InstallPSModule (115)</a> .</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2011/12/17/introducing-import-psmodule/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint: Writing Custom Web Service for SharePoint in Supported Mode (part-1)</title>
		<link>http://blog.libinuko.com/2011/08/27/sharepoint-writing-custom-web-service-for-sharepoint-in-supported-mode-part-1/</link>
		<comments>http://blog.libinuko.com/2011/08/27/sharepoint-writing-custom-web-service-for-sharepoint-in-supported-mode-part-1/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 17:27:56 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/2011/08/27/sharepoint-writing-custom-web-service-for-sharepoint-in-supported-mode-part-1/</guid>
		<description><![CDATA[English If you have read my comments on the Writing Custom Web Service for SharePont, Is it supported here (http://blog.libinuko.com/2011/02/16/sharepoint-writing-custom-web-service-for-sharepoint-is-it-supported/) ; you may have already created standard ASPNET web services. It is working, but with some limitation: You can not have path virtualization Virtualization is one of SharePoint’s technique provided by SPVirtualPath provider, that enable virtualization of your [...] <a href="http://blog.libinuko.com/2011/08/27/sharepoint-writing-custom-web-service-for-sharepoint-in-supported-mode-part-1/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>English</p>
<p>If you have read my comments on the Writing Custom Web Service for SharePont, Is it supported here (<a title="http://blog.libinuko.com/2011/02/16/sharepoint-writing-custom-web-service-for-sharepoint-is-it-supported/" href="http://blog.libinuko.com/2011/02/16/sharepoint-writing-custom-web-service-for-sharepoint-is-it-supported/">http://blog.libinuko.com/2011/02/16/sharepoint-writing-custom-web-service-for-sharepoint-is-it-supported/</a>) ; you may have already created standard ASPNET web services. It is working, but with some limitation:</p>
<ol>
<li>You can not have path virtualization
<p>Virtualization is one of SharePoint’s technique provided by SPVirtualPath provider, that enable virtualization of your web service path. For example, list.asmx will be available for <a href="http://mysite.com/_vti_bin/lists.asmx">http://mysite.com<strong>/_vti_bin/lists.asmx</strong></a> , or <a href="http://mysite.com/sites/myothersitecollection/_vti_bin/lists.asmx">http://mysite.com/sites/myothersitecollection<strong>/_vti_bin/lists.asmx</strong></a>. The site collection has been virtualized by SharePoint.</p>
<p>Without virtualization any web service consumer will have to access to the same path, usually in the root; for example <a href="http://&lt;webapps&gt;/_services/mywebservice.asmx">/_services/mywebservice.asmx&quot;&gt;/_services/mywebservice.asmx&quot;&gt;http://&lt;webapps&gt;/_services/mywebservice.asmx</a></p>
</li>
<li>You can not have SPContext
<p>SPContext is very powerful object in SharePoint development. Using this context, we can retrieve current SharePoint context without having to instantiate it. For example, you can get current SPWeb by calling SPContext.Current.Web – and you don’t need to dispose it (in fact you’re not suppose to dispose it). Still using SPContext you can have direct access to list and everything under SharePoint.</p>
<p>Without having direct access to SPContext, you have to instantiate SPWeb or SPSite using normal constructor with URL as parameter. It means new SPSite/SPWeb thread in the server memory, and you have to dispose it once you’ve done working with it.</p>
</li>
</ol>
<p>So, how can we write custom web service for SharePoint in supported mode?</p>
<p>Before we start, we have to understand SharePoint architecture and how does the processing works for web services. I take following picture from <a href="http://msdn.microsoft.com/en-us/library/bb892189(v=office.12).aspx">SharePoint Architecture</a> in MSDN. It describe how SharePoint process our request. There is SPHttpApplication which has SPRequestModule and any additional ASP.NET Module; and before the request returned back to the user SPHttpHandler is doint the job.</p>
<p><a href="http://blog.libinuko.com/files/2011/08/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.libinuko.com/files/2011/08/image_thumb.png" width="670" height="299" /></a></p>
<p><strong>How SharePoint process web services?</strong></p>
<p>If we dig into into the process on how SharePoint process request to web services in _vti_bin.</p>
<p><a href="http://blog.libinuko.com/files/2011/08/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.libinuko.com/files/2011/08/image_thumb2.png" width="809" height="282" /></a></p>
<p>There are 3 scenarios of http request to the web services,</p>
<ol>
<li>Disco request, identified by suffix ?DISCO in the web service address. For example, */_vti_bin/list.asmx?Disco </li>
<li>WSDL request, identified by suffix ?WSDL in the web service address. For example, */_vti_bin/list.asmx?Wsdl </li>
<li>Web service post request. For example, */_vti_bin/list.asmx?op=GetListItems </li>
</ol>
<p>Every request will be processed by SPHttpHandler (SharePoint) and ScriptHandlerFactory (system.web.extension), but the SPHttpHandler will be selective only for Disco and Wsdl request.</p>
<p>On disco/wsdl request, SPHttpHandler will transfer the request to wsdisco.aspx or wswsdl.aspx using <strong>Server.Execute</strong> operation. This operation ensure that wsdisco.aspx/wswsdl.aspx is receiving same request object. wsDISCO.aspx or wsWSDL.aspx will then instantiate SharePoint Context object. Any *.aspx will be successfully instantiate SharePoint context object because they are managed by SPHttpApplication and hence it also impacted by SPVirtualPath provider from SharePoint which will activate path virtualization.</p>
<p>Next, wsDISCO.aspx will transfer the request to the &lt;service&gt;DISCO.aspx and wsWSDL.aspx will transfer to the &lt;service&gt;WSDL.aspx – using Server.Execute operation. So here we have seen 2 transfer operation. At the end, the result is correct WSDL/DISCO request. The correct WSDL/DISCO will point to the correct virtual path of the request. <em>(Remember how do you create &lt;service&gt;disco.aspx / &lt;service&gt;wsdl.aspx) </em></p>
<p>When a consumer use the contract and tries to consume it. The SPHttpHandler will no longer intercept the request, but the normal ScriptHandlerFactory from System.Web.Extensions. However with the correct path in disco/wsdl, now the asmx now have the ability to look into current context from SharePoint. And hence you will be able to use SPContext.Current.Web in custom web services.</p>
<p>Part-2 is how to start create custom web services. I will need help from my buddy <a href="http://codebender.denniland.com">Denni</a> , he will code for me. –<img class="wlEmoticon wlEmoticon-openmouthedsmile" alt="Open-mouthed smile" src="http://blog.libinuko.com/files/2011/08/wlEmoticon-openmouthedsmile.png" /></p>
<p>&#160;</p>
<p>References</p>
<p>1. Writing Custom Web Services for SharePoint Products and Technology (<a title="http://msdn.microsoft.com/en-us/library/dd583131(v=office.11).aspx" href="http://msdn.microsoft.com/en-us/library/dd583131(v=office.11).aspx">http://msdn.microsoft.com/en-us/library/dd583131(v=office.11).aspx</a>)</p>
<p>2. SharePoint Architecture (<a title="http://msdn.microsoft.com/en-us/library/bb892189(v=office.12).aspx" href="http://msdn.microsoft.com/en-us/library/bb892189(v=office.12).aspx">http://msdn.microsoft.com/en-us/library/bb892189(v=office.12).aspx</a> )</p>
<p>3. Architectural Overview of Windows SharePoint Services (<a title="http://msdn.microsoft.com/en-us/library/dd583133(v=office.11).aspx" href="http://msdn.microsoft.com/en-us/library/dd583133(v=office.11).aspx">http://msdn.microsoft.com/en-us/library/dd583133(v=office.11).aspx</a>)</p>
<p>4. Modifying Built-In SharePoint Files (<a title="http://msdn.microsoft.com/en-us/library/bb803457(v=office.12).aspx" href="http://msdn.microsoft.com/en-us/library/bb803457(v=office.12).aspx">http://msdn.microsoft.com/en-us/library/bb803457(v=office.12).aspx</a>)</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2011/08/27/sharepoint-writing-custom-web-service-for-sharepoint-in-supported-mode-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: Remote StsAdm using PowerShell</title>
		<link>http://blog.libinuko.com/2011/08/24/powershell-remote-stsadm-using-powershell/</link>
		<comments>http://blog.libinuko.com/2011/08/24/powershell-remote-stsadm-using-powershell/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 16:39:45 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[StsAdm]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/2011/08/24/powershell-remote-stsadm-using-powershell/</guid>
		<description><![CDATA[English In large network, issuing a command to remote server from current terminal is sometimes necessary. Some propose client-server mode; for example Remote StsAdm (http://netstsadm.codeplex.com/) and other propose to use PsExec (http://thingsthatshouldbeeasy.blogspot.com/2009/08/run-stsadm-commands-remotely.html). The client-server mode requires installation of 3rd party tools. This kind of installation sometimes (or most of the time) is forbidden by company security [...] <a href="http://blog.libinuko.com/2011/08/24/powershell-remote-stsadm-using-powershell/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p><strong><em>English </em></strong></p>
<p>In large network, issuing a command to remote server from current terminal is sometimes necessary. Some propose client-server mode; for example Remote StsAdm (<a href="http://netstsadm.codeplex.com/">http://netstsadm.codeplex.com/</a>) and other propose to use PsExec (<a href="http://thingsthatshouldbeeasy.blogspot.com/2009/08/run-stsadm-commands-remotely.html">http://thingsthatshouldbeeasy.blogspot.com/2009/08/run-stsadm-commands-remotely.html</a>).</p>
<p>The client-server mode requires installation of 3rd party tools. This kind of installation sometimes (or most of the time) is forbidden by company security policy. <br />
	Second option using PsExec from SysInternal (now part of Microsoft) doesn&#39;t requires installation to SharePoint server and may be the correct approach. However, I am not convince that this tools will be compatible with the future Operating System.</p>
<p><strong>So, what is the option? </strong> <br />
	PowerShell and Remoting!</p>
<p>PowerShell has been introduced during Windows 2008 era. However, Windows 2003 server owner can apply KB968930 (http://support.microsoft.com/kb/968930) to bring PowerShell functionality to their server. PowerShell will replace command.com because of the flexibility &#8211; enabling integration between shell and operating system itself.</p>
<p><strong>Let&#39;s get our job done </strong></p>
<p>1. First enable remoting on the SharePoint Server.</p>
<pre class="brush: ps;  html-script: false">    Enable-PSRemoting -Force</pre>
<p>2.&nbsp; Prepare the stsadm command alias</p>
<pre class="brush: ps; html-script: false"> $executable = &quot;$env:ProgramFiles\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe&quot; </pre>
<p>&nbsp;</p>
<p>3.&nbsp; Remember my previous post about how to avoid double hop problem? (<a href="http://blog.libinuko.com/2011/04/29/powershell-how-to-overcome-double-hop-problem-in-powershell-remoting-2/" title="http://blog.libinuko.com/2011/04/29/powershell-how-to-overcome-double-hop-problem-in-powershell-remoting-2/">http://blog.libinuko.com/2011/04/29/powershell-how-to-overcome-double-hop-problem-in-powershell-remoting-2/</a>) . Now we will create new function that uses Invoke-RemoteCommand. Basically, we will construct commandline parameter for Invoke-RemoteCommand. We also try to provide AS-IF user call stsadm.</p>
<pre class="brush:ps; html-script: false">function StsAdm
{
   param(
      [string] $commandOptions,
      [string] $username,
      [string] $password
   )

   $executable = &quot;$env:ProgramFiles\Common Files\Microsoft Shared\web server extensions\12\bin\stsadm.exe&quot;

   Invoke-RemoteCommand -commandline &quot;&#39;$executable&#39; $commandOptions&quot; -username $username -password $password

}

Usage : StsAdm -commandOptions &quot;-o enumwebs&quot; -username &quot;setup account&quot; -password &quot;setup password&quot;</pre>
<p>And voila, you have remote stsadm function without compromising security policy.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2011/08/24/powershell-remote-stsadm-using-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webcast : Microsoft Project 2010 Solution Starters series</title>
		<link>http://blog.libinuko.com/2011/07/29/webcast-microsoft-project-2010-solution-starters-series/</link>
		<comments>http://blog.libinuko.com/2011/07/29/webcast-microsoft-project-2010-solution-starters-series/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 09:28:00 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Project Server]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/2011/07/29/webcast-microsoft-project-2010-solution-starters-series/</guid>
		<description><![CDATA[English There are some webcast about Microsoft Project 2010 Solution Starters. It demonstrate the power and extensibility of SharePoint 2010 and Project 2010. Find out yourself on user experience series and code walkthrough here: User experience series: 1. Microsoft Project 2010 Solution Starters &#8211; User Experience #1 2. Microsoft Project 2010 Solution Starters &#8211; User [...] <a href="http://blog.libinuko.com/2011/07/29/webcast-microsoft-project-2010-solution-starters-series/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>English</p>
<p>There are some webcast about Microsoft Project 2010 Solution Starters. It demonstrate the power and extensibility of SharePoint 2010 and Project 2010. Find out yourself on user experience series and code walkthrough here:</p>
<p>User experience series:</p>
<p>1. Microsoft Project 2010 Solution Starters &#8211; <a title="http://www.microsoft.com/events/series/epm.aspx?tab=Webcasts&amp;seriesid=51&amp;webcastid=13339" href="http://www.microsoft.com/events/series/epm.aspx?tab=Webcasts&amp;seriesid=51&amp;webcastid=13339">User Experience #1</a>    <br />2. Microsoft Project 2010 Solution Starters &#8211; <a href="http://www.microsoft.com/events/series/epm.aspx?tab=Webcasts&amp;seriesid=51&amp;webcastid=13340">User Experience #2</a></p>
<p>Code walkthrough:</p>
<p>1. <a href="http://www.microsoft.com/events/series/epm.aspx?tab=Webcasts&amp;seriesid=51&amp;webcastid=13341">Microsoft Project 2010 Solution Starters Drilldown &amp; Code Walkthrough</a> #1    <br />2. <a href="http://www.microsoft.com/events/series/epm.aspx?tab=Webcasts&amp;seriesid=51&amp;webcastid=13342">Microsoft Project 2010 Solution Starters Drilldown &amp; Code Walkthrough #2</a>    <br />3. <a href="http://www.microsoft.com/events/series/epm.aspx?tab=Webcasts&amp;seriesid=51&amp;webcastid=13342">Microsoft Project 2010 Solution Starters Drilldown &amp; Code Walkthrough #3</a>    <br />4. <a href="http://www.microsoft.com/events/series/epm.aspx?tab=Webcasts&amp;seriesid=51&amp;webcastid=13343">Microsoft Project 2010 Solution Starters Drilldown &amp; Code Walkthrough #4</a></p>
<p>So , are you dare to take the challenge and move to the new platform?</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2011/07/29/webcast-microsoft-project-2010-solution-starters-series/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : Compress files with Windows an improved version</title>
		<link>http://blog.libinuko.com/2011/06/09/powershell-compress-files-with-windows-an-improved-version/</link>
		<comments>http://blog.libinuko.com/2011/06/09/powershell-compress-files-with-windows-an-improved-version/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 14:43:00 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/?p=666</guid>
		<description><![CDATA[English When I am looking for a way to compress file(s) into Zip, I find a blog from David Aiken here (Compress Files with Windows PowerShell then package a Windows Vista Sidebar Gadget) . I will just focus on Add-Zip function and nothing more. Here is the original code: &#160; function Add-Zip { param([string]$zipfilename) [...] <a href="http://blog.libinuko.com/2011/06/09/powershell-compress-files-with-windows-an-improved-version/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>English</p>
<p>When I am looking for a way to compress file(s) into Zip, I find a blog from David Aiken here (<a href="http://blogs.msdn.com/b/daiken/archive/2007/02/12/compress-files-with-windows-powershell-then-package-a-windows-vista-sidebar-gadget.aspx">Compress Files with Windows PowerShell then package a Windows Vista Sidebar Gadget</a>) . I will just focus on Add-Zip function and nothing more.</p>
<p>Here is the original code:</p>
<p>&#160;</p>
<pre class="brush: ps; highlight: [12,16]; html-script: false">function Add-Zip
{
    param([string]$zipfilename) 

    if(-not (test-path($zipfilename)))
    {
           set-content $zipfilename (&quot;PK&quot; + [char]5 + [char]6 + (&quot;$([char]0)&quot; * 18))
           (dir $zipfilename).IsReadOnly = $false
     } 

     $shellApplication = new-object -com shell.application
     $zipPackage = $shellApplication.NameSpace($zipfilename) 

     foreach($file in $input)
     {
            $zipPackage.CopyHere($file.FullName)
            Start-sleep -milliseconds 500
     }
}

usage: dir c:\demo\files\*.* -Recurse | add-Zip c:\demo\myzip.zip</pre>
<p>I am raising two problems with the code:</p>
<p>1. Looking at the usage example, it is clear that the function accept <strong>only fully path filename</strong>. The reason, on line-12 , the $shellApplication.NameSpace parameter is $zipfilename; and this is not possible without giving fully path filename. </p>
<p>2. On line-16, the operation expect that $input array will contains object with FullName properties, that why the usage example uses DIR. What about if you just want to specify a filename?</p>
<p>With the 2 problem above, I am ready to improve that function. In the new improved version, Get-ChildItem will help us to convert any string representation of a file to a fully path filename. It won’t break DIR piping functionality, since actually Get-ChildItem is dir (and extra) functionality.</p>
<p>Here is the improved version:</p>
<pre class="brush: ps; highlight: [5,15,16]; html-script: false">function Add-Zip
{
	param([string]$zipfilename)

    $currFile = $zipfilename | get-childitem
	if(-not (test-path($zipfilename)))
	{
		set-content $currFile.FullName (&quot;PK&quot; + [char]5 + [char]6 + (&quot;$([char]0)&quot; * 18))
		(dir $currFile.FullName).IsReadOnly = $false
	}

	$shellApplication = new-object -com shell.application
	$zipPackage = $shellApplication.NameSpace($currFile.Fullname)

	$input | % {
            $file = $_ | get-childitem
            $zipPackage.CopyHere($file.FullName)
            Start-sleep -milliseconds 500
	}
}

usage: &quot;FileInThisFolder.txt&quot; -Recurse | add-Zip &quot;ZipInThisFolder.zip&quot;
        dir c:\demo\files\*.* -Recurse | add-Zip c:\demo\myzip.zip</pre>
<p>So, I hope you enjoy the improved version.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2011/06/09/powershell-compress-files-with-windows-an-improved-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell : How to overcome double-hop problem in PowerShell remoting</title>
		<link>http://blog.libinuko.com/2011/04/29/powershell-how-to-overcome-double-hop-problem-in-powershell-remoting-2/</link>
		<comments>http://blog.libinuko.com/2011/04/29/powershell-how-to-overcome-double-hop-problem-in-powershell-remoting-2/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 09:34:00 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/2011/04/29/powershell-how-to-overcome-double-hop-problem-in-powershell-remoting-2/</guid>
		<description><![CDATA[English: I am interesting to the PowerShell remoting topic from PowerShell Cookbook Chapter 29 here (http://www.pavleck.net/powershell-cookbook/ch29.html). In order to solve double-hop problem, it uses schedule task. The sample create schedule task to Enable-PSRemoting in remote machine. But don’t you think we need something more generic to overcome double-hop problem? PowerShell offers Enable-WSManCredSSP or Kerberos so that the [...] <a href="http://blog.libinuko.com/2011/04/29/powershell-how-to-overcome-double-hop-problem-in-powershell-remoting-2/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>English:</p>
<p>I am interesting to the PowerShell remoting topic from PowerShell Cookbook Chapter 29 here (<a title="http://www.pavleck.net/powershell-cookbook/ch29.html" href="http://www.pavleck.net/powershell-cookbook/ch29.html">http://www.pavleck.net/powershell-cookbook/ch29.html</a>). In order to solve double-hop problem, it uses schedule task. The sample create schedule task to Enable-PSRemoting in remote machine.</p>
<p>But don’t you think we need something more generic to overcome double-hop problem? PowerShell offers Enable-WSManCredSSP or Kerberos so that the process can delegates the credential to execute next-hop process. However,  CredSSP is only available on Windows 7 and above. What about OS before Windows 7 or Windows Server 2008?  If you have Windows 7 or Windows Server 2008 – you may follow tutorial in this link (<a title="http://www.ravichaganti.com/blog/?p=1230" href="http://www.ravichaganti.com/blog/?p=1230">http://www.ravichaganti.com/blog/?p=1230</a>). But if you have Windows 2003 or previous version, then you must keep reading.</p>
<p>So, lets start by defining our function Invoke-RemoteCommand. This command will accept :</p>
<p>1. (Optional) Taskname, name of task identifier<br />
2. Commandline, actual command for example powershell or cmd.exe<br />
3. Username, credential to execute the command<br />
4. Password, password for the credential to execute the command</p>
<div id="scid:DFDE9937-D816-47f4-A306-7B60D5CE5AC0:18da64f8-eb0d-4d0a-9cc2-0ea02f884616" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: powershell; gutter: true; first-line: 1; tab-size: 4;  toolbar: true; ">function Invoke-RemoteCommand{

    param(
       [System.String]
       $taskname = (get-date -format "'Demo task' dd-MM-yyyy hh.mm.ss"),

       [System.String]
       $commandline = "cmd /c 'dir c:\'",

       [Parameter(Mandatory=$true)]
       [String]
       $username,

       [parameter(Mandatory = $true)]
       [String]
       $password
   )

    schtasks /create /tn $taskname /tr $commandline /sc weekly  /ru $username /rp $password | out-null
    schtasks /run /tn $taskname | out-null
    write-host "Waiting task execution." -nonewline -foreground green
    do {
      $taskStatus = schtasks /query /fo csv /v | convertfrom-csv | ? { $_.TaskName.TrimStart("\") -eq "$taskname"}
      sleep 10
      write-host "." -nonewline -foreground green
    } while ($taskStatus."Status" -eq "Running")
    write-host "Success!" -foreground green
    schtasks /delete /tn $taskname /f | out-null
    return $taskStatus
}</pre>
<p>&nbsp;</p>
<p>The function will create schedule task on remote machine, execute, wait until execution complete and return the result.</p></div>
<p>For example, we want to list directory of the ServerX by issuing command to ServerY. Normally, following command will fail because of double-hop problem (it doesn’t matter whether you supply user credential, it will still failed):</p>
<div id="scid:DFDE9937-D816-47f4-A306-7B60D5CE5AC0:ac27d6ef-2c31-4cd1-965a-67e91c478a52" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: powershell; gutter: true; first-line: 1; tab-size: 4;  toolbar: true; ">Invoke-Command -ComputerName ServerY -Script { "dir \\ServerX\d$" }</pre>
<p>&nbsp;</p>
</div>
<p>Using the new function, we change the command into</p>
<div id="scid:DFDE9937-D816-47f4-A306-7B60D5CE5AC0:279054e4-83f7-4d63-a860-568d720f9fb6" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;">
<pre class="brush: powershell; gutter: true; first-line: 1; tab-size: 4;  toolbar: true; ">invoke-command -script { Invoke-RemoteCommand -cmd "powershell -noprofile -command 'dir \\ServerX\d$'" -username "domain\user" -password "password" }</pre>
<p>&nbsp;</p>
</div>
<p>The last script will performs following:</p>
<p>1. Create schedule tasks with a specific identifier</p>
<p>2. Command in schedule task is “powershell –noprofile …..”</p>
<p>3. Execute schedule tasks</p>
<p>4. Wait until execution completes</p>
<p>5. Return the status</p>
<p>Finally, the script will work in Windows 2003 , Windows 7, Windows Vista or Windows 2008.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2011/04/29/powershell-how-to-overcome-double-hop-problem-in-powershell-remoting-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: How to create Cascading Lookup Field using Client Object Model</title>
		<link>http://blog.libinuko.com/2011/01/29/sharepoint-2010-how-to-create-cascading-lookup-field-using-client-object-model/</link>
		<comments>http://blog.libinuko.com/2011/01/29/sharepoint-2010-how-to-create-cascading-lookup-field-using-client-object-model/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 15:49:50 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Client Object Model]]></category>
		<category><![CDATA[SharePoint Designer]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/2011/01/29/sharepoint-2010-how-to-create-cascading-lookup-field-using-client-object-model/</guid>
		<description><![CDATA[English In previous post I have demonstrated “How to create cascading lookup field” in SharePoint 2010 using InfoPath. I will extend the possibility by utilizing Client Object Model and SharePoint Designer; therefore we don’t need InfoPath to have the cascading lookup field. Using same scenario where City is cascading lookup field from the selected Country, we’ll see [...] <a href="http://blog.libinuko.com/2011/01/29/sharepoint-2010-how-to-create-cascading-lookup-field-using-client-object-model/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>English</p>
<p>In previous post I have demonstrated “<a href="http://blog.libinuko.com/2010/07/21/sharepoint-2010-how-to-create-cascading-lookup-field/" target="_blank">How to create cascading lookup field</a>” in SharePoint 2010 using InfoPath. I will extend the possibility by utilizing Client Object Model and SharePoint Designer; therefore we don’t need InfoPath to have the cascading lookup field.</p>
<p>Using same scenario where City is cascading lookup field from the selected Country, we’ll see together how Client Object Model solve the problem. In this solution we need to create JS referral to SP.js for Client Object Model and JQuery to help us working with DOM.</p>
<br /><img src="http://i.ytimg.com/vi/sFiPtoGpjFI/0.jpg" alt="media" /><br />
[See post to watch Flash video]
<p>Some key points in the video:</p>
<p>1. Put JQuery distribution in 14hive\Layouts.</p>
<p>2. Add Javascript link referral in the AdditionalPageHead place holder.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;">   1:</span> <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">SharePoint:ScriptLink</span> <span style="color: #ff0000;">Language</span><span style="color: #0000ff;">="Javascript"</span> <span style="color: #ff0000;">Localizable</span><span style="color: #0000ff;">="False"</span> <span style="color: #ff0000;">runat</span><span style="color: #0000ff;">="server"</span> <span style="color: #ff0000;">Name</span><span style="color: #0000ff;">="jquery-1.4.4.min.js"</span><span style="color: #0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;">   2:</span> <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">SharePoint:ScriptLink</span> <span style="color: #ff0000;">Name</span><span style="color: #0000ff;">="SP.js"</span> <span style="color: #ff0000;">runat</span><span style="color: #0000ff;">="server"</span> <span style="color: #ff0000;">OnDemand</span><span style="color: #0000ff;">="true"</span> <span style="color: #ff0000;">Localizable</span><span style="color: #0000ff;">="false"</span><span style="color: #0000ff;">/&gt;</span></pre>
<p><!--CRLF--></p>
</div>
</div>
<p>3. Add Javascript code to modify cascading selector and create Client Object Model call to retrieve cascaded value in Main conten place holder.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;">   1:</span> &lt;script type=<span style="color: #006080;">"text/javascript"</span>&gt;</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;">   2:</span> <span style="color: #008000;">// JQuery_Script</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;">   3:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;">   4:</span> <span style="color: #0000ff;">var</span> spListItems;</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;">   5:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100.07%; font-family: 'Courier New', courier, monospace; direction: ltr; height: 20px; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;">   6:</span> <span style="color: #008000;">// Cascading lookup main function</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;">   7:</span> <span style="color: #0000ff;">function</span> FilterLookup(filterSource,lookupList)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;">   8:</span> {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;">   9:</span>    <span style="color: #0000ff;">var</span> filterElement = $(<span style="color: #006080;">"select[title='"</span> + filterSource + <span style="color: #006080;">"'] option:selected"</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;">  10:</span>    <span style="color: #0000ff;">if</span>(filterElement.length == 0) <span style="color: #0000ff;">return</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;">  11:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;">  12:</span>    <span style="color: #0000ff;">var</span> selectedFilterText =  filterElement.text();</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;">  13:</span>    <span style="color: #0000ff;">var</span> selectedFilterValue = filterElement.value;</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;">  14:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;">  15:</span>    <span style="color: #0000ff;">var</span> clientCtx = <span style="color: #0000ff;">new</span> SP.ClientContext.get_current();</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060;">  16:</span>    <span style="color: #0000ff;">var</span> spList = clientCtx.get_web().get_lists().getByTitle(lookupList);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum17" style="color: #606060;">  17:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum18" style="color: #606060;">  18:</span>    <span style="color: #0000ff;">var</span> camlQuery = <span style="color: #0000ff;">new</span> SP.CamlQuery();</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum19" style="color: #606060;">  19:</span>    camlQuery.set_viewXml(<span style="color: #006080;">'&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=\''</span>+ filterSource +<span style="color: #006080;">'\'/&gt;'</span> +</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum20" style="color: #606060;">  20:</span>         <span style="color: #006080;">'&lt;Value Type=\'Text\'&gt;'</span>+ selectedFilterText +<span style="color: #006080;">'&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;'</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum21" style="color: #606060;">  21:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum22" style="color: #606060;">  22:</span>    <span style="color: #0000ff;">this</span>.spListItems = spList.getItems(camlQuery);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum23" style="color: #606060;">  23:</span>    clientCtx.load(spListItems);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum24" style="color: #606060;">  24:</span>    clientCtx.executeQueryAsync(Function.createDelegate(<span style="color: #0000ff;">this</span>, <span style="color: #0000ff;">this</span>.onQuerySucceeded), Function.createDelegate(<span style="color: #0000ff;">this</span>, <span style="color: #0000ff;">this</span>.onQueryFailed) );</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum25" style="color: #606060;">  25:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum26" style="color: #606060;">  26:</span> } <span style="color: #008000;">// </span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum27" style="color: #606060;">  27:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum28" style="color: #606060;">  28:</span> <span style="color: #0000ff;">function</span> onQuerySucceeded(sender, args) {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum29" style="color: #606060;">  29:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum30" style="color: #606060;">  30:</span>    alert(<span style="color: #0000ff;">this</span>.selectedFilterText);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum31" style="color: #606060;">  31:</span>    <span style="color: #008000;">// Get CityElement Select or Input</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum32" style="color: #606060;">  32:</span>    <span style="color: #0000ff;">var</span> cityElement = $(<span style="color: #006080;">"select[title='City']"</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum33" style="color: #606060;">  33:</span>    <span style="color: #0000ff;">if</span>(cityElement.length == 0) { alert(<span style="color: #006080;">'Unknown'</span>); }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum34" style="color: #606060;">  34:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum35" style="color: #606060;">  35:</span>     <span style="color: #0000ff;">var</span> options = <span style="color: #006080;">''</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum36" style="color: #606060;">  36:</span>     <span style="color: #0000ff;">var</span> listItemEnumerator = spListItems.getEnumerator();</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum37" style="color: #606060;">  37:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum38" style="color: #606060;">  38:</span>     <span style="color: #0000ff;">while</span> (listItemEnumerator.moveNext()) {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum39" style="color: #606060;">  39:</span>         <span style="color: #0000ff;">var</span> oListItem = listItemEnumerator.get_current();</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum40" style="color: #606060;">  40:</span>         options += <span style="color: #006080;">'&lt;option value="'</span> + oListItem.get_id() + <span style="color: #006080;">'"&gt;'</span> + oListItem.get_item(<span style="color: #006080;">'Title'</span>) +<span style="color: #006080;">'&lt;/option&gt;'</span>;</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum41" style="color: #606060;">  41:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum42" style="color: #606060;">  42:</span>    cityElement.html(options);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum43" style="color: #606060;">  43:</span> }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum44" style="color: #606060;">  44:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum45" style="color: #606060;">  45:</span> <span style="color: #0000ff;">function</span> onQueryFailed(sender, args) {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum46" style="color: #606060;">  46:</span>     alert(<span style="color: #006080;">'Request failed. '</span> + args.get_message() + <span style="color: #006080;">'\n'</span> + args.get_stackTrace());</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum47" style="color: #606060;">  47:</span> }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum48" style="color: #606060;">  48:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum49" style="color: #606060;">  49:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum50" style="color: #606060;">  50:</span> <span style="color: #008000;">// Attach function on document ready</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum51" style="color: #606060;">  51:</span> $(document).ready(</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum52" style="color: #606060;">  52:</span>    <span style="color: #0000ff;">function</span>() {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum53" style="color: #606060;">  53:</span>       ExecuteOrDelayUntilScriptLoaded(FilterLookup,<span style="color: #006080;">"sp.js"</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum54" style="color: #606060;">  54:</span>       <span style="color: #008000;">//FilterLookup("Country","City");</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum55" style="color: #606060;">  55:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum56" style="color: #606060;">  56:</span>        <span style="color: #008000;">// Get CountryElement Select or Input</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum57" style="color: #606060;">  57:</span>       <span style="color: #0000ff;">var</span> countryElement = $(<span style="color: #006080;">"select[title='Country']"</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum58" style="color: #606060;">  58:</span>       <span style="color: #0000ff;">if</span>(countryElement.length == 0)</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum59" style="color: #606060;">  59:</span>       {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum60" style="color: #606060;">  60:</span>            countryElement = $(<span style="color: #006080;">"input[title='Country']"</span>);</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum61" style="color: #606060;">  61:</span>       }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum62" style="color: #606060;">  62:</span>       <span style="color: #0000ff;">if</span>(countryElement.length != 0) {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum63" style="color: #606060;">  63:</span>        <span style="color: #0000ff;">if</span>(countryElement[0].optHid) {</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum64" style="color: #606060;">  64:</span>           $(<span style="color: #006080;">"input[id='"</span> + countryElement[0].optHid + <span style="color: #006080;">"']"</span>).bind(<span style="color: #006080;">"propertychange"</span>, <span style="color: #0000ff;">function</span>() { FilterCity(); });</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum65" style="color: #606060;">  65:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum66" style="color: #606060;">  66:</span>        } <span style="color: #0000ff;">else</span>{</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum67" style="color: #606060;">  67:</span>           $(<span style="color: #006080;">"select[title='Country']"</span>).change(<span style="color: #0000ff;">function</span>() { FilterLookup(<span style="color: #006080;">"Country"</span>,<span style="color: #006080;">"City"</span>); });</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum68" style="color: #606060;">  68:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum69" style="color: #606060;">  69:</span>        }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum70" style="color: #606060;">  70:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum71" style="color: #606060;">  71:</span>    }</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum72" style="color: #606060;">  72:</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum73" style="color: #606060;">  73:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum74" style="color: #606060;">  74:</span>    }); <span style="color: #008000;">// Document ready</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum75" style="color: #606060;">  75:</span> </pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum76" style="color: #606060;">  76:</span> &lt;/script&gt;</pre>
<p><!--CRLF--></p>
</div>
</div>
<p>4. Finally save and set the new form as default form.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2011/01/29/sharepoint-2010-how-to-create-cascading-lookup-field-using-client-object-model/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: How to change rating icons</title>
		<link>http://blog.libinuko.com/2010/12/27/sharepoint-2010-how-to-change-rating-icons/</link>
		<comments>http://blog.libinuko.com/2010/12/27/sharepoint-2010-how-to-change-rating-icons/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 17:19:11 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Howto]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/2010/12/27/sharepoint-2010-how-to-change-rating-icons/</guid>
		<description><![CDATA[English: Sometimes you may received a request to change rating icons, from a normal star to a love icon. So, how would you do it? Figure 1. Original rating icons Figure 2. Modified love rating icons 1. Find and prepare rating icons.  In this case I will need to prepare 4 styles rating icons Title Sample Size a. Empty Rating 16&#215;16 b. Selected Rating 16&#215;16 c. Rating [...] <a href="http://blog.libinuko.com/2010/12/27/sharepoint-2010-how-to-change-rating-icons/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>English:</p>
<p>Sometimes you may received a request to change rating icons, from a normal star to a love icon. So, <strong>how would you do it</strong>?</p>
<p><a href="http://blog.libinuko.com/files/2010/12/OriginalRating.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="OriginalRating" src="http://blog.libinuko.com/files/2010/12/OriginalRating_thumb.png" border="0" alt="OriginalRating" width="709" height="275" /></a><br />
<strong><em>Figure 1. Original rating icons</em></strong></p>
<p><a href="http://blog.libinuko.com/files/2010/12/LoveRating.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="LoveRating" src="http://blog.libinuko.com/files/2010/12/LoveRating_thumb.png" border="0" alt="LoveRating" width="710" height="261" /></a><br />
<em><strong>Figure 2. Modified love rating icons</strong></em></p>
<p>1. Find and prepare rating icons.  In this case I will need to prepare 4 styles rating icons</p>
<table border="1" cellspacing="0" cellpadding="2" width="681">
<tbody>
<tr>
<td width="286" valign="top"><strong>Title</strong></td>
<td width="258" valign="top"><strong>Sample</strong></td>
<td width="135" valign="top"><strong>Size</strong></td>
</tr>
<tr>
<td width="286" valign="top">a. Empty Rating</td>
<td width="258" valign="top"><a href="http://blog.libinuko.com/files/2010/12/love_ratingempty.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="love_ratingempty" src="http://blog.libinuko.com/files/2010/12/love_ratingempty_thumb.png" border="0" alt="love_ratingempty" width="20" height="20" /></a></td>
<td width="135" valign="top">16&#215;16</td>
</tr>
<tr>
<td width="286" valign="top">b. Selected Rating</td>
<td width="258" valign="top"><a href="http://blog.libinuko.com/files/2010/12/love_RatingsNew.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="love_RatingsNew" src="http://blog.libinuko.com/files/2010/12/love_RatingsNew_thumb.png" border="0" alt="love_RatingsNew" width="20" height="20" /></a></td>
<td width="135" valign="top">16&#215;16</td>
</tr>
<tr>
<td width="286" valign="top">c. Rating Overlay</td>
<td width="258" valign="top"><a href="http://blog.libinuko.com/files/2010/12/love_ratings.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="love_ratings" src="http://blog.libinuko.com/files/2010/12/love_ratings_thumb.png" border="0" alt="love_ratings" width="309" height="21" /></a></td>
<td width="135" valign="top">448&#215;16</td>
</tr>
<tr>
<td width="286" valign="top">d. Rating Overlay RightToLeft</td>
<td width="258" valign="top"><a href="http://blog.libinuko.com/files/2010/12/love_Ratingsrtl.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="love_Ratingsrtl" src="http://blog.libinuko.com/files/2010/12/love_Ratingsrtl_thumb.png" border="0" alt="love_Ratingsrtl" width="305" height="24" /></a></td>
<td width="135" valign="top">448&#215;16</td>
</tr>
</tbody>
</table>
<p> </p>
<p>2. Save the new icons under 14 hive\Images.</p>
<p>3. Create script to modify SPWeb property bag. To ease our job, I will use PowerShell script as follows,</p>
<blockquote><p><span style="font-family: Century Gothic;"><strong><span style="color: #8fb08c;">[System.Reflection.Assembly]::</span>LoadWithPartialName(<span style="color: #c0504d;">&#8220;Microsoft.SharePoint&#8221;</span>) &gt; <span style="color: #ff0000;">$null<br />
</span></strong></span><span style="font-family: Century Gothic;"><strong><span style="color: #ff0000;"><br />
$spSite</span> = <span style="color: #0000ff;">new-object</span> <span style="color: #646b86;">Microsoft.SharePoint.SPSite</span><span style="color: #c0504d;">(&#8220;</span></strong></span><span style="font-family: Century Gothic;"><strong><span style="color: #c0504d;">http://win2k8&#8243;);</span></strong></span><br />
<span style="font-family: Century Gothic;"><strong><span style="color: #ff0000;">$spWeb</span> = $spSite.OpenWeb();</strong></span></p>
<p><span style="font-family: Century Gothic;"><strong><span style="color: #ff0000;">$spWeb</span>.Properties["Ratings_NewRatingIconUrl"] =<span style="color: #c0504d;"> &#8220;/_layouts/Images/love_RatingsNew.png&#8221;</span>;<br />
<span style="color: #ff0000;">$spWeb</span>.Properties["Ratings_EmptyIconUrl"] = <span style="color: #c0504d;">&#8220;/_layouts/Images/love_RatingsEmpty.png&#8221;</span>;<br />
<span style="color: #ff0000;">$spWeb</span>.Properties["Ratings_ImageStripUrl"] = <span style="color: #c0504d;">&#8220;/_layouts/Images/love_Ratings.png&#8221;</span>;<br />
<span style="color: #ff0000;">$spWeb</span>.Properties["Ratings_ImageStripRtlUrl"] =<span style="color: #c0504d;"> &#8220;/_layouts/Images/love_Ratingsrtl.png&#8221;</span>;</strong></span></p>
<p><span style="font-family: Century Gothic;"><strong><span style="color: #ff0000;">$spWeb</span>.Properties.Update();<br />
<span style="color: #ff0000;">$spWeb</span>.Dispose();<br />
<span style="color: #ff0000;">$spSite</span>.Dispose();</strong></span></p>
<p><span style="font-family: Century Gothic; color: #0000ff;"><strong>iisreset</strong></span></p></blockquote>
<p> </p>
<p>4. Voila ! And you can refresh your browser to see the changes.</p>
<p>5. Finally you can distribute your solution into a solutions package with feature activation events to register/un-register custom rating images.</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2010/12/27/sharepoint-2010-how-to-change-rating-icons/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SharePoint 2010: Howto disable My Site and My Profile link</title>
		<link>http://blog.libinuko.com/2010/10/10/sharepoint-2010-howto-disable-my-site-and-my-profile-link/</link>
		<comments>http://blog.libinuko.com/2010/10/10/sharepoint-2010-howto-disable-my-site-and-my-profile-link/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 04:51:36 +0000</pubDate>
		<dc:creator>cakriwut</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[My Profile]]></category>
		<category><![CDATA[MySite]]></category>

		<guid isPermaLink="false">http://blog.libinuko.com/2010/10/10/sharepoint-2010-howto-disable-my-site-and-my-profile-link/</guid>
		<description><![CDATA[English: This is graphical guidelines to disable My Site or My Profile link in a portal. &#160; 1. Open Central Administration , and click on “Manage service applications”. &#160; 2. Open Central Administration , and click on “Manage service applications”. &#160; 3. Click on “Manage User Permissions” &#160; 4. Remove “Use Personal Features” permission for the Groups/Users. 5. If you can’t see the [...] <a href="http://blog.libinuko.com/2010/10/10/sharepoint-2010-howto-disable-my-site-and-my-profile-link/">[read more...]</a>]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p>English:</p>
<p>This is graphical guidelines to disable My Site or My Profile link in a portal.</p>
<p>&#160;</p>
<p>1. Open Central Administration , and click on “Manage service applications”.</p>
<p><a href="http://blog.libinuko.com/files/2010/10/HideMySite1.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HideMySite1" border="0" alt="HideMySite1" src="http://blog.libinuko.com/files/2010/10/HideMySite1_thumb.jpg" width="615" height="420" /></a> </p>
<p>&#160;</p>
<p>2. Open Central Administration , and click on “Manage service applications”.</p>
<p><a href="http://blog.libinuko.com/files/2010/10/HideMySite2.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HideMySite2" border="0" alt="HideMySite2" src="http://blog.libinuko.com/files/2010/10/HideMySite2_thumb.jpg" width="705" height="429" /></a> </p>
<p>&#160;</p>
<p>3. Click on “Manage User Permissions”</p>
<p><a href="http://blog.libinuko.com/files/2010/10/HideMySite3.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HideMySite3" border="0" alt="HideMySite3" src="http://blog.libinuko.com/files/2010/10/HideMySite3_thumb.jpg" width="582" height="383" /></a></p>
<p>&#160;</p>
<p>4. Remove “Use Personal Features” permission for the Groups/Users.</p>
<p><a href="http://blog.libinuko.com/files/2010/10/HideMySite5.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HideMySite5" border="0" alt="HideMySite5" src="http://blog.libinuko.com/files/2010/10/HideMySite5_thumb.jpg" width="568" height="485" /></a></p>
<p>5. If you can’t see the new rules being reflected in the site. You can restart “User Profile Service”</p>
<p><a href="http://blog.libinuko.com/files/2010/10/HideMySite7.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HideMySite7" border="0" alt="HideMySite7" src="http://blog.libinuko.com/files/2010/10/HideMySite7_thumb.jpg" width="602" height="386" /></a>&#160;&#160;&#160;&#160; <a href="http://blog.libinuko.com/files/2010/10/HideMySite8.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HideMySite8" border="0" alt="HideMySite8" src="http://blog.libinuko.com/files/2010/10/HideMySite8_thumb.jpg" width="707" height="349" /></a> </p>
<p>6. And now, the users will not be able to see My Site / My Profiles link.</p>
<p><a href="http://blog.libinuko.com/files/2010/10/HideMySite9.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="HideMySite9" border="0" alt="HideMySite9" src="http://blog.libinuko.com/files/2010/10/HideMySite9_thumb.jpg" width="577" height="368" /></a></p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://blog.libinuko.com/2010/10/10/sharepoint-2010-howto-disable-my-site-and-my-profile-link/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

