<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Saurabh Khatri</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/saurabh1/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/saurabh1/feed.xml</link>
    <description>The blog mainly focuses on Sharepoint and related technologies</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:27:16 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SharePoint 2010 List Joins - Understanding</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/sharepoint-2010-list-joins-understanding</link>
      <pubDate>Fri, 23 May 2014 00:14:00 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2014/05/23/sharepoint-2010-list-joins-understanding/</guid>
      <description><![CDATA[SharePoint 2010 + supports Joins in the SPQuery for over more than 4 year. But would like to take...]]></description>
      <content:encoded><![CDATA[<div style="width: 100%;">
<p>SharePoint 2010 + supports Joins in the SPQuery for over more than 4 year. But would like to take this blog on it to clarify the concepts the way I have understand the things.</p>
<p>Foremost to create a join, We should make sure that we are not stuck because of any of the restriction mentioned in below note.</p>
<table style="background-color: #ccc;">
<tbody>
<tr><th align="left"><span><strong>Note</strong></span></th></tr>
<tr>
<td>
<ul>
<li><span>There are requirements to keep in mind when creating list joins. You cannot join just any two lists, regardless of type. And if two lists can be joined, not just any primary and foreign field can be used as the &ldquo;join on&rdquo; pair of fields.&nbsp;<em><strong>The field in the primary list must be a Lookup type field and it must lookup to the field in the foreign list</strong>.</em>&nbsp;For this reason, all joins mirror existing lookup relations between lists.</span></li>
<li><span>If you wish to include fields of your lookup list in your query clause or viewfields expression. </span>Only the following types of fields can be included in a&nbsp;ProjectedFields&nbsp;element:</li>
<ul>
<li>
<p>Calculated (treated as plain text)</p>
</li>
<li>
<p>ContentTypeId</p>
</li>
<li>
<p>Counter</p>
</li>
<li>
<p>Currency</p>
</li>
<li>
<p>DateTime</p>
</li>
<li>
<p>Guid</p>
</li>
<li>
<p>Integer</p>
</li>
<li>
<p>Note (one-line only)</p>
</li>
<li>
<p>Number</p>
</li>
<li>
<p>Text</p>
</li>
</ul>
</ul>
</td>
</tr>
</tbody>
</table>
<p><strong>SPQuery.Joins and SPQuery.ProjectedFields, </strong>together these two properties when used in conjugation Joins the two or more SharePoint list.</p>
<p>&nbsp;We will look at each of these in more detail when we will discuss and understand the syntax. But definition is as below</p>
<p><span style="text-decoration: underline; font-size: medium;"><strong>Joins Clause</strong></span> :&nbsp;</p>
<p><span>The&nbsp;</span>Joins<span>&nbsp;element contains one or more&nbsp;</span>Join<span>&nbsp;elements. There are two types of possible Joins inner join or left outer join between two lists.&nbsp;</span></p>
<table style="background-color: #cccccc;" border="0">
<tbody>
<tr><th align="left"><strong>Key Terms</strong></th></tr>
<tr>
<td>
<ul>
<li>Parent List - SharePoint list on which we will be calling the GetItems() method. As earlier discussed in the <strong>Note above, t</strong>his list should be having a lookup column to a foreign list or other list..</li>
</ul>
</td>
</tr>
<tr>
<td>
<ul>
<li>Other List - Other referenced list</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;<span>At least one of these joins must be from the parent list of the view, called the primary list, and some other list, called the foreign list.&nbsp;<span>But there can be additional joins from that foreign list to another foreign list, and so on.</span></span></p>
<p><span style="text-decoration: underline; font-size: medium;"><strong>ProjectedFields</strong></span></p>
<p><span style="font-size: medium;"><span style="font-size: small;">The&nbsp;<strong>ProjectedFields&nbsp;</strong>element creates fields from the foreign lists so that they can be used in the list view.&nbsp;</span></span></p>
<p>&nbsp;</p>
<hr style="width: 1px;" width="1" /></div>]]></content:encoded>
    </item>
    <item>
      <title>Working with UserProfileService.asmx</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/working-with-userprofileservice-asmx</link>
      <pubDate>Mon, 01 Jul 2013 06:16:00 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2013/07/01/working-with-userprofileservice-asmx/</guid>
      <description><![CDATA[There is very less documentation available on calling a userprofile web service. Though we can...]]></description>
      <content:encoded><![CDATA[<div>   <p>There is very less documentation available on calling a userprofile web service. Though we can use SPService.js a codeplex solution which is a jQuery wrapper and calls the webservice using jquery Ajax method. A very neat solution but it adds another file to be downloaded to client when i don't need the entire library (this is completely my view as per my understanding). So I decided not use it SPService.js library and call the UserProfileService.asmx directly.</p>    <p>The UserProfileService.asmx uses SOAP messages to invoke a method and response is returned in a SOAP format.</p>    <p>List of methods can be referenced from MSDN <a href="http://msdn.microsoft.com/en-us/library/aa980957(v=office.12).aspx">http://msdn.microsoft.com/en-us/library/aa980957(v=office.12).aspx</a></p>    <p>To call a web-service we need to create a SOAP envelop. Example to Add a collegue</p>    <p>var soapEnv = &quot;&lt;soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'&gt;     <br /><span style="font-size: 12px;">&lt;soap:Body&gt;       <br />&lt;AddColleague xmlns='http://microsoft.com/webservices/SharePointPortalServer/UserProfileService'&gt;        <br /></span><span style="font-size: 12px;">&lt;accountName&gt;&quot;+loginName+&quot;&lt;/accountName&gt;       <br />&lt;colleagueAccountName&gt;&quot; + account +&quot;&lt;/colleagueAccountName&gt;        <br />&lt;group&gt;Group&lt;/group&gt;        <br />&lt;privacy&gt;Public&lt;/privacy&gt;        <br />&lt;isInWorkGroup&gt;true&lt;/isInWorkGroup&gt;        <br />&lt;/AddColleague&gt;        <br />&lt;/soap:Body&gt;         <br />&lt;/soap:Envelope&gt; &quot;</span></p>    <p><span style="font-size: 12px;">AddCollegue is the method Name in UserProfileService.asmx class, and it take five parameters namely accountName, collegueAccountName, group, privacy, isInWorkGroup. All needs to be the part of soap:Body as defined. Also remember SOAP is case </span>sensitive<span style="font-size: 12px;"> format so elements names should follow the case as defined in the MSDN method description.       <br /></span></p>    <p><span style="font-size: 12px;">Second thing make sure the xml namespaces are correct</span></p>    <p><span style="font-size: 12px;">Third you need to add a SOAP Action in the Request header in </span><span style="font-size: 12px;">beforeSend</span></p>    <p><span style="font-size: 12px;">.       <br />var SOAPAction =&#160; &quot;http://microsoft.com/webservices/SharePointPortalServer/UserProfileService/AddColleague&quot;</span></p>    <p><span style="font-size: 12px;">Notice the name of the method at the end.       <br /></span></p>    <p>ServiceAddress will look like</p>    <p>var serviceAddress = window.location.protocol + &quot;//&quot; + window.location.hostname + &quot;/en-us/_vti_bin/userprofileservice.asmx&quot;;</p>    <p>And all together call to web service will look as below:</p>    <blockquote>     <p>$.ajax({       <br />&#160;&#160;&#160; url: serviceAddress,        <br />&#160;&#160;&#160; beforeSend: function(xhr) {        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xhr.setRequestHeader(&quot;SOAPAction&quot;, SOAPAction);        <br />&#160;&#160;&#160; },        <br />&#160;&#160; type: &quot;POST&quot;,        <br />&#160;&#160; dataType: &quot;xml&quot;,        <br />&#160;&#160; data: soapEnv,        <br />&#160;&#160; complete: function(xData, status)        <br />&#160;&#160; {        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(status == &quot;success&quot;)        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Do your javascriopt to notify user that collegue added successfully        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }        <br />&#160;&#160;&#160; },        <br />&#160;&#160;&#160; contentType: &quot;text/xml; charset=\&quot;utf-8\&quot;&quot;        <br /> });</p>      <p>Strom is is one such tool that helped me testing the Operations </p>   </blockquote>    <p>&#160;</p> </div>]]></content:encoded>
    </item>
    <item>
      <title>Creation of Horizontal or Vertical Menu in InfoPath form</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/creation-of-horizontal-or-vertical-menu-in-infopath-form</link>
      <pubDate>Wed, 16 May 2012 08:41:28 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2012/05/16/creation-of-horizontal-or-vertical-menu-in-infopath-form/</guid>
      <description><![CDATA[How to get Horizontal or Vertical Tab Menu in an InfoPath form. So here I am creating a Horizontal...]]></description>
      <content:encoded><![CDATA[<p align="justify">How to get Horizontal or Vertical Tab Menu in an InfoPath form. So here I am creating a Horizontal Menu. I am going to use a series of Image Buttons that are available and keep them together so as to make them look like a Tabbed Horizontal Menu. Just like below. Now use a paint tool like Adobe Photoshop or something to create Images UI for each button. </p>  <p align="justify">You can create two or three images one for each to show different states of button like: Selected Tab, Unselected Tab, and one for Hover. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/71/metablogapi/0640.image_0BE88101.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-71-metablogapi/0640.image_5F00_0BE88101.png"><img style="display: inline;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/71/metablogapi/3276.image_thumb_3B56EFCD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-71-metablogapi/3276.image_5F00_thumb_5F00_3B56EFCD.png" width="680" height="83" /></a></p>  <p align="justify">For each View in a form I have Kept Image Button when user clicks on it. It switches the view and loads a different tab. To set the picture use the property menu to set image for hover and display image, initially just to save effort set all images such that all show image you created for Unselected Tab. </p>  <p align="justify"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/71/metablogapi/8463.image_thumb_203E20BF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-71-metablogapi/8463.image_5F00_thumb_5F00_203E20BF.png" width="454" height="89" /></p>  <p align="justify">Create a view for each button and to add a switching view action use Add a rule on a button of type Action&gt;Switch View to Desired Tab.</p>  <p align="justify">Now Copy the Menu Layout we just created on the views. And change the image of selected view on each tab with ‘Selected Tab’ image.</p>  <p>This is is just a trick to achieve it in InfoPath as it doesn't come with a Menu Control. Similar way we can create a vertical Menu also.</p>  <p>~Hope you enjoyed reading it.~</p>]]></content:encoded>
    </item>
    <item>
      <title>InfoPath Restricting Minimum and Maximum on Repeating Fields</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/infopath-restricting-minimum-and-maximum-on-repeating-fields</link>
      <pubDate>Wed, 16 May 2012 05:24:21 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2012/05/16/infopath-restricting-minimum-and-maximum-on-repeating-fields/</guid>
      <description><![CDATA[One thing I noticed that one can not put restriction on the number of rows in a repeating field in...]]></description>
      <content:encoded><![CDATA[<p align="justify"><font size="2" face="Segoe WP">One thing I noticed that one can not put restriction on the number of rows in a repeating field in an InfoPath form using InfoPath 2010 designer. But this can be achieved by modifying MySchema.xsd file. </font></p>  <p align="justify"><font size="2" face="Segoe WP">What all you need to do is to extract the .xsn file (Extract it by changing the .xsn extension .Cab). There will be file with the name</font> MySchma.xsd. But before that you need to add a repeating control to your form. You can locate this field in your Schema and which will have properties as minOccurs and maxOccurs</p> <!--more-->  <table border="0" cellspacing="0" cellpadding="2" width="535" align="center"><tbody>     <tr>       <td style="background-color: rgb(204, 204, 204);" valign="top" width="533">         <p>&#160;&#160;&#160;&#160; &lt;xsd:complexType&gt;            <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:sequence&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element ref=&quot;my:LetterNo&quot; minOccurs=&quot;5&quot; maxOccurs=&quot;10&quot;/&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:sequence&gt;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:complexType&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </p>       </td>     </tr>   </tbody></table>  <p align="justify">So here maxOccurs will control the maximum number of occurrence which here is set to 10 and minOccurs control the minimum number of repeating fields that should be visible when the form will be first uploaded. The default values for the designer for minOccurs is 0 and that for maxOccurs is unbounded.</p>  <p align="justify">So when you are done with the changes save the schema file and open the manifest.xsf file in design mode and publish it. You will view minimum 5 occurrence for Letter Number Control and if you click on insert item it will not let you add more than 10 items and will show a message in a popup.</p>  <p align="justify"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/71/metablogapi/8461.image_1A7D4F6B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-71-metablogapi/8461.image_5F00_1A7D4F6B.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/71/metablogapi/4744.image_thumb_6E605279.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-71-metablogapi/4744.image_5F00_thumb_5F00_6E605279.png" width="342" height="123" /></a></p>  <p>&#160;</p>  <p>Hope this is a helpful post. Thanks for reading.</p>]]></content:encoded>
    </item>
    <item>
      <title>Create UserProfiles and Properties using powershell</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/create-userprofiles-and-properties-using-powershell</link>
      <pubDate>Sat, 25 Feb 2012 07:41:00 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2012/02/25/create-userprofiles-and-properties-using-powershell/</guid>
      <description><![CDATA[This is the boiler plate code to create user profile. This is pretty useful when you are creating...]]></description>
      <content:encoded><![CDATA[<p class="scroll">This is the boiler plate code to create user profile. This is pretty useful when you are creating bulk users for a test environment.</p>
<p class="scroll"><code class="js"> Add-PSSnapin "Microsoft.SharePoint.PowerShell"<br /> $site = "http://myweb"<br /> $context = Get-SPServiceContext -Site $site<br /> $web = Get-SPWeb -Identity $site<br /> $group = $web.Groups["Owners"]<br /> $upm = New-Object -TypeName Microsoft.Office.Server.UserProfiles.UserProfileManager -ArgumentList $context<br /> <br /> $userslist = Import-Csv -Path .\UserProfile.csv<br /> for($count=0; $count -lt $userslist.Count; $count++)<br /> {</code></p>
<p class="scroll"><code class="js">#Create User Profile<br /> $upm.CreateUserProfile($userslist[$count].UserName)<br /> $profileproperty = $upm.GetUserProfile($userslist[$count].UserName)</code></p>
<p class="scroll"><code class="js">#Custom User Profile being updated for the user<br /> $profileproperty["Location"].Value = $userslist[$count].Location<br /> $profileproperty["BusinessGroup"].Value = $userslist[$count].BusinessGroup<br /> <br /> $profileproperty.Commit()<br /> </code></p>
<p class="scroll"><code class="js">#Adding users to the owner groups of the site<br /> $group.AddUser($user.UserName,"","","")<br /> $group.update()<br /> <br /> }</code></p>
<p class="scroll"></p>
<p class="scroll">The script is useful to add user in&nbsp;bulk. It assumes that the users are already created in AD. It reads a CSV file for the users and custom properties are updated..Though user profile can be&nbsp;synchronized&nbsp;with AD</p>
<p class="scroll">UserName | Location | BusinessGroup&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Adjusting DateTime according UserProfile TimeZone and Server regional Settings in SharePoint</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/adjusting-datetime-according-userprofile-timezone-and-server-regional-settings-in-sharepoint</link>
      <pubDate>Tue, 21 Feb 2012 12:23:00 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2012/02/21/adjusting-datetime-according-userprofile-timezone-and-server-regional-settings-in-sharepoint/</guid>
      <description><![CDATA[In SharePoint you might have to deal with TimeZone. Your Web Front End Server might be configured to...]]></description>
      <content:encoded><![CDATA[<p class="scroll" align="justify">In SharePoint you might have to deal with TimeZone. Your Web Front End Server might be configured to different Time Zone. Your UserProfile Property is a different time zone</p>  <p align="justify"></p>  <p align="justify">So, To Adjust the Offsets, We need to find the TimeZone of the Web and Convert that UTC. From The UTC date can then convert be back to User's TimeZone preferences stored in the UserProfile with TimeZone property.</p>  <p align="justify">Here the screen shots will show you where these setting are there in UI. For web this setting will be under <span style="color: rgb(0, 0, 255);">SiteAction&gt;SiteAdmininstration&gt;Regional Settings</span></p>  <p></p>  <p class="scroll"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/71/6253.Capture.PNG" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-71/6253.Capture.PNG"><img style="margin-right: auto; margin-left: auto; float: none; display: block;" border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/48/71/6253.Capture.PNG" original-url="http://blogs.msdn.com/resized-image.ashx/__size/200x100/__key/communityserver-blogs-components-weblogfiles/00-00-01-48-71/6253.Capture.PNG" /></a></p>  <table border="0" cellspacing="0" cellpadding="2" width="541" align="center"><tbody>     <tr>       <td style="background-color: rgb(204, 204, 204);" valign="top" width="539"><code class="csharp">SPtimezone serverzone= SPContext.Current.Web.RegionalSettings.TimeZone;            <br /><code class="csharp">             <br />//This Date is stored is SharePoint Store such as list Created or Modified </code>            <br />DateTime utcDate = serverZone.LocalTimeToUTC(date);             <br />            <br />LocalTime=&quot;userZone.UTCToLocalTime(utcDate);</code></td>     </tr>   </tbody></table>  <p class="scroll">&#160;</p>  <p class="scroll">To get the user's time zone from the UserProfile Store.</p>  <table border="0" cellspacing="0" cellpadding="2" width="542" align="center"><tbody>     <tr>       <td style="background-color: rgb(204, 204, 204);" valign="top" width="540"><code class="csharp">SPServiceContext serverContext = SPServiceContext.GetContext(SPContext.Current.Web.Site);            <br />            <br />UserProfileManager profileManager = new UserProfileManager(serverContext);             <br />            <br />userZone = (SPTimeZone)profile[PropertyConstants.TimeZone].Value;</code></td>     </tr>   </tbody></table>  <p class="scroll">&#160;</p>  <p class="scroll">Hopefully the approach and information discussed here will be useful. Thanks for reading.</p>  <p class="scroll">~Bye for now~</p>]]></content:encoded>
    </item>
    <item>
      <title>Powershell DLL Locking issue</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/powershell-dll-locking-issue</link>
      <pubDate>Sun, 22 Jan 2012 14:32:00 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2012/01/22/powershell-dll-locking-issue/</guid>
      <description><![CDATA[Problem:&nbsp;
I tired to Disable feature in Powerhsell after loading the DLLs of my application in...]]></description>
      <content:encoded><![CDATA[<p><strong>Problem:&nbsp;</strong></p>
<p>I tired to Disable feature in Powerhsell after loading the DLLs of my application in my application and webtemplate activated the features successfully. But when I went ahead and tried Disable one of my application feature it gave me the following error. &nbsp;</p>
<p>PS C:\Build6\Release\Deployment\PowerShellScripts&gt; Disable-SPFeature -Identity "WebActivityFeature" -Url http://contoso.com</p>
<p>Disable-SPFeature : Failed to load receiver assembly "Web.WCM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=817f6507759ed875" for feature "Web.WCM_WebActivityFeature" (ID: bb566682-2405-e8a-905d-accf318f6213).: System.IO.FileNotFoundException: Could not load file or assembly 'Project.Web.WCM,Version=1.0.0.0, Culture=neutral, PublicKeyToken=817f6507759ed875' or one of its dependencies. The system cannot find the file specified.</p>
<p>File name: 'Project.Web.WCM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=817f6507759ed875'</p>
<p>&nbsp;&nbsp; at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,</p>
<p>Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)</p>
<p>&nbsp;&nbsp; at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection)<br />&nbsp; &nbsp;at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection)<br />&nbsp; &nbsp;at System.Reflection.Assembly.Load(String assemblyString)<br />&nbsp; &nbsp;at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()</p>
<p>WRN: Assembly binding logging is turned OFF.</p>
<p>To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.<br />Note: There is some performance penalty associated with assembly bind failure logging.<br />To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].<br />At line:1 char:18<br />+ Disable-SPFeature &lt;&lt;&lt;&lt;&nbsp; -Identity "Project.Web.WCM_WebActivityFeedFeature" -Url <a href="http://inet2.biogenidec.com:1561">http://contoso.com<br /></a>&nbsp; &nbsp; + CategoryInfo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : InvalidData: (Microsoft.Share...tDisableFeature:&nbsp; &nbsp;SPCmdletDisableFeature) [Disable-SPFeature], ArgumentException&nbsp; &nbsp; + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletDisableFeature</p>
<p></p>
<p>This deactivation of feature was the part of my script. and I want to do it in the same window. Here is the solution I tried and it worked for me well.</p>
<hr width="90%" style="width: 90%;" />
<p>SOLUTION : I tried following approach to overcome the issue, I Invoked all my command in a separate PS Session.</p>
<p>$session = New-PSSession -Name "SessionName"</p>
<p>Invoke-Command -Session $session -Script {Add-PSSnapin "Microsoft.SharePoint.Powershell}</p>
<p>Invoke-Command -Session $session -Script {param([Parameter(Position=0, Mandatory=$true)] [string] $siteUrl); Disable-SPFeature -Identity "WebActivityFeature" -Url $siteUrl -Confirm:$false} -ArgumentList $subSite.Url</p>]]></content:encoded>
    </item>
    <item>
      <title>Design Solution to Activate Solution Features on only a specific web application</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/design-solution-to-activate-solution-features-on-only-a-specific-web-application</link>
      <pubDate>Sat, 14 Jan 2012 12:58:00 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2012/01/14/design-solution-to-activate-solution-features-on-only-a-specific-web-application/</guid>
      <description><![CDATA[There may be a need when you will be asked to have you features activated on just your own...]]></description>
      <content:encoded><![CDATA[<p style="text-align: justify;"><span style="font-family: verdana, geneva;">There may be a need when you will be asked to have you features activated on just your own web-application. The problem might be tricky and may change on from scenario to scenario. Here I am providing one such solution.&nbsp;</span></p>
<p style="text-align: justify;"><span style="font-family: verdana, geneva;">We can tackle this problem by creating a Feature. The &nbsp;Activated event of this&nbsp;Feature Event&nbsp;receiver&nbsp;will hold the&nbsp;responsibility&nbsp;to determine the webapplication. We can create a key&nbsp;siteUrl&nbsp;in AppSettings in the web.config file and key will hold the web-application url.&nbsp;</span></p>
<p><span><span>public override void FeatureActivated(SPFeatureReceiverProperties properties)<br />{</span></span></p>
<p style="padding-left: 30px;"><span>&nbsp;<span class="Apple-tab-span" style="white-space: pre;"> </span> SPSite currentSite = (SPSite)properties.Feature.Parent;</span></p>
<p><span style="padding-left: 30px;">string strWeb = currentSite.RootWeb.Url.ToUpperInvariant().Split(new string[] { "/SITES/" }, StringSplitOptions.RemoveEmptyEntries)[0].TrimEnd('/');</span><br /> <span style="padding-left: 30px;">appUrl = Convert.ToString(ConfigurationManager.AppSettings[siteUrl], CultureInfo.InvariantCulture);</span><br /> <span style="padding-left: 30px;">//Compare this appUrl and strWeb if it doesnot match; thow a SPException</span><br /> }</p>
<p><span style="font-family: verdana, geneva;">Throwing a SPException will stop your feature from getting activated on anyother webapplication that will not have matching siteUrl key in its webconfig file. So this feature will not be activated.</span></p>
<p><span style="font-family: verdana, geneva;">Now you want to stop all you features that are the part of your solution from getting activated unintentionally. So, Lets make all our solution features dependent on our above feature. Thus, None of the feature will be able to activate as the above feature can only be activated on the desired application and dependent feature will be activated only if our master feature will be activated.</span></p>
<p><span style="font-family: verdana, geneva;">The solution may be obvious, but useful and handles the scenario very well.</span> <span style="font-family: verdana, geneva;">Thanks for reading!</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Selecting dynamically added using Jquery with a class selector in IE 7</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/selecting-dynamically-added-using-jquery-with-a-class-selector-in-ie-7</link>
      <pubDate>Fri, 13 Jan 2012 07:13:00 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2012/01/13/selecting-dynamically-added-using-jquery-with-a-class-selector-in-ie-7/</guid>
      <description><![CDATA[I faced a issue, when selecting the nodes that were dynamically added to my page and a class is...]]></description>
      <content:encoded><![CDATA[<p>I faced a issue, when selecting the nodes that were dynamically added to my page and a class is attached to this new node. This same class was also attached to other nodes that were not dynamically created. I was using a jquery selector to select all the nodes, but I was&nbsp;surprised&nbsp;to found that it is not selecting the dynamically added nodes. And this same thing was working fine when using IE8.</p>
<pre><span style="text-decoration: underline;"><strong>PROBLEM</strong></span></pre>
<pre>I have a HTML where in some of the nodes have been added by Created html elements document.createElement(). And child nodes have been appended to it as innerHTML.</pre>
<pre><span class="Apple-tab-span" style="white-space: pre;"> </span>    <span class="Apple-tab-span" style="white-space: pre;"> </span>    var newDiv = document.createElement('li');<br /><br />            newDiv.innerHTML = "&lt;div class='items' data-item='" + itemName + "'&gt;</pre>
<pre style="padding-left: 90px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;div class='classA'&gt;</pre>
<pre style="padding-left: 90px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>...</pre>
<pre style="padding-left: 90px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;/div&gt;</pre>
<pre style="padding-left: 90px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;div class='classB'&gt;</pre>
<pre style="padding-left: 90px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>...</pre>
<pre style="padding-left: 90px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;/div&gt;</pre>
<pre style="padding-left: 60px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;/div&gt;";</pre>
<pre><span class="Apple-tab-span" style="white-space: pre;"> </span>parentNode.<span class="Apple-tab-span" style="white-space: pre;">appendChild(newDiv)</span>;</pre>
<pre></pre>
<p>This parent node contains other child nodes with similar HTML structure but they are not added dynamically. Now I am trying to get all the nodes using jquery selector. item</p>
<p>$('.item[data-item="itemName"]') ==&gt; This should ideally give me the node where data-item is itemName and class is .item. This works good in IE8 and but doesn't select the node in IE7.</p>
<p><span style="text-decoration: underline;"><strong>Work Around</strong></span></p>
<p><span><span>child = $('.outerClass div').filter(function () {<br />return this.getAttribute('class') == 'items' &amp;&amp; this.getAttribute('data-items').toLowerCase() == "itemName " <span>})</span></span></span></p>
<pre>And I was able to select the desired node.</pre>
<p>Hope it helps.</p>
<p>Thanks!</p>]]></content:encoded>
    </item>
    <item>
      <title>Creating List Instance Schema in SharePoint 2010</title>
      <link>https://docs.microsoft.com/archive/blogs/saurabh1/creating-list-instance-schema-in-sharepoint-2010</link>
      <pubDate>Sat, 26 Nov 2011 00:55:00 GMT</pubDate>
      <dc:creator><![CDATA[Saurabh Khatri]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/saurabh1/2011/11/26/creating-list-instance-schema-in-sharepoint-2010/</guid>
      <description><![CDATA[During the last few days, I have created a way where I am able to produce a List Instance Schema in...]]></description>
      <content:encoded><![CDATA[<p style="text-align: justify;">During the last few days, I have created a way where I am able to produce a List Instance Schema in 10 - 15 mins.</p>
<p style="text-align: justify;">What I am doing is, I am creating a List Instance OOB, Add the <strong>New fields</strong> as per my business requirement and extracting the schema by saving it in a List Template(.stp file) in such a way that I can use it in Schema.xml definition. This method helps me creating List Instance and package it very fast and makes my task simple.Though some knowledge of schema file gives a better understanding of what we are doing. But any one can do it by following simple steps.</p>
<p style="text-align: justify;">But Before I talk about extracting the List Schema from the List Template. I will be preparing the Solution Structure.&nbsp;</p>
<p style="text-align: justify;">Assumtions: I am assuming that we have already created SharePoint Project in Visual Studio 2010.</p>
<p><span style="text-decoration: underline;">Preparing Solution Structure</span></p>
<ol>
<li>In your visual studio instance, Right Click on your sharepoint project and click on Add &gt; New Item.</li>
<li>From the Wizard, choose the SharePoint List Instance.</li>
<li>a) Give some name your List Instance(Display Name), I will give this 'MyNewCustomList'<br />b) Choose a List Template, You can choose any List Template, and choose a List Instance, Let me choose Custom List to keep it simple.<br />c) Give List a URL, "Lists\MyNewCustomList"<br />d) Click ok to close the wizard.&nbsp;</li>
<li>&nbsp;After step 3, we will be having a SharePointItem &nbsp;'<span class="Apple-style-span" style="white-space: pre;">MyNewCustomList' </span>of type&nbsp;List Instance with a element.xml file, instantiating it from TemplateType=100, that will create a custom list with a Title Column in it. But we wanted to add the fields to this custom schema.(In SharePoint 2010 we can create a List Instance without creating a ListTemplate by specifying CustomSchema property for ListInstance.&nbsp;<a href="http://msdn.microsoft.com/en-us/library/ms476062.aspx">http://msdn.microsoft.com/en-us/library/ms476062.aspx</a><br /><br />
<table border="0" cellpadding="0" cellspacing="0" style="border-width: 0px; background-color: #7a7b85;">
<tbody>
<tr>
<td>
<p style="background-color: #ffffff;"><span style="font-family: arial, helvetica, sans-serif;">&lt;ListInstance Title="<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; white-space: normal;">MyNewCustomList</span>" OnQuickLaunch="TRUE" TemplateType="100" Url="Lists/<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; white-space: normal;">MyNewCustomList</span>" Description="My List Instance"<br /><span class="Apple-tab-span"> </span>CustomSchema="</span><span class="Apple-style-span" style="white-space: normal;">MyNewCustomList</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif;">\Schema.xml"</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif;">&nbsp;/</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif;">&gt;</span></p>
</td>
</tr>
</tbody>
</table>
<br /><br /></li>
<li>Now Lets Add a Schema.xml File to your SharePointItem.&nbsp;</li>
<li>Also include this file into your SharePointItem.data file.<br />This is how we do it it. Click on the your 'MyNewCustomList' in Solution Explorer in Visual Studio. Right click Open Folder in Windows Explorer. Open SharePointItem.Data in notepad<br />&lt;ProjectItemFile Source="Schema.xml" Target="MyNewCustomList\" Type="ElementFile" /&gt;</li>
</ol>
<p>We are done with Solution Preparation steps.</p>
<p>We will now create a Custom List in SharePoint with ''MyNewCustomList". Go to List Settings and Add the columns, as per the requirement. After doing with all changes&nbsp;whether&nbsp;it is a addition of List Column, Creatiypeng a View, addition of some content Type etc.&nbsp;</p>
<ol>
<li>Save this list as Template. Go to Template&nbsp;Gallery,&nbsp;and Download your list template. This file will be a .stp file.\</li>
<li>Change the File Extenstion to .zip.</li>
<li>Open the zip file, it will contain a manifest.xml</li>
<li>Open Manifest.xml file in some nice editor like notepad++.</li>
<li>Carefully, Locate node "&lt;List&gt;" in this xml. Copy this entire section of &lt;List&gt;...&lt;/List&gt; and now paste it in your schema.xml file we created in above steps.</li>
</ol>
<p>Few Final Modifications and we are done in Schema.xml file.</p>
<ol>
<li>Remove the name attribute containing List GUID of your previous List.<br />&lt;List Name="SomeGUid" ...&gt; remove this Name attribute, we don't need this in our schema</li>
<li>
<p><span>Replace the following &nbsp;nodes &lt;View&gt;<br /><br /></span>&lt;View BaseViewID="1" Type="HTML" Level="1" ContentTypeID="0x" WebPartZoneID="Main" OrderedView="TRUE" DisplayName="All Links" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/links.png" Url="AllItems.aspx"&gt;</p>
<p>Also replace the Forms Node with the below one.</p>
<p>&lt;Forms&gt;</p>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><span><o:p></o:p></span>&lt;Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /&gt;<br />&lt;Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /&gt;<br /><span><o:p></o:p></span><span>&lt;</span><span>Form</span><span> </span><span>Type</span><span>=</span><span>"</span><span>NewForm</span><span>"</span><span> </span><span>Url</span><span>=</span><span>"</span><span>NewForm.aspx</span><span>"</span><span> </span><span>SetupPath</span><span>=</span><span>"</span><span>pages\form.aspx</span><span>"</span><span> </span><span>WebPartZoneID</span><span>=</span><span>"</span><span>Main</span><span>"</span><span> /&gt;<br /></span></blockquote>
&lt;/Forms&gt;
<p></p>
Great we are done, Now we can include this ListInstance in a feature and create a package. Activating that feature will create a ListInstance.</li>
</ol>
<p>&nbsp;</p>
<p>Hope the technique saves a lot of time especially for the beginners :)&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>