<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-948216771623611945</atom:id><lastBuildDate>Mon, 07 Jul 2025 07:12:37 +0000</lastBuildDate><category>Code</category><category>Error</category><category>Webpart</category><category>Basics</category><category>Configuration</category><category>Security</category><category>Tips</category><category>STSADM</category><category>Sharepoint 2010</category><category>Search</category><category>CAML</category><category>SharePoint</category><category>Issue</category><category>Powershell</category><category>ASP.Net</category><category>Tools</category><category>Controls</category><category>Administration</category><category>Timer</category><category>Look and Feel</category><category>Bug</category><category>Deployment</category><category>Web.config</category><category>Best Practice</category><category>WCF</category><category>Tricks</category><category>Workflow</category><category>ActiveX</category><category>Data View Webpart</category><category>Comparision</category><category>JQuery</category><category>SilverLight</category><category>MOSS</category><category>Office</category><category>Sharepoint Designer</category><category>WebService</category><category>Event Handler</category><category>InfoPath</category><category>Javascript</category><category>User Profile</category><category>XSLT</category><category>Audience</category><category>BDC</category><category>Checklist</category><category>Client Object Model</category><category>Codeplex</category><category>Publishing</category><category>Reports</category><category>Script</category><category>Testing</category><category>Visual Studio</category><category>.Net</category><category>Audit</category><category>Authentication</category><category>Database</category><category>Debug</category><category>MVC2</category><category>Query String</category><category>SSP</category><category>Training</category><category>Backup</category><category>Claims</category><category>Excel Services</category><category>Governance</category><category>Hotfix</category><category>Installation</category><category>Integration</category><category>Learn</category><category>MySites</category><category>Service Application</category><category>Virtualization</category><category>BCS</category><category>Branding</category><category>CSV</category><category>Logging</category><category>Migration</category><category>PopUp</category><category>Project Server 2007</category><category>Record Management</category><category>Report Viewer</category><category>Ribbon</category><category>WishList</category><title>SharePoint Sandeep</title><description>&amp;lt;/Sandeep K Nahta&amp;gt;</description><link>http://snahta.blogspot.com/</link><managingEditor>noreply@blogger.com (Sandeep)</managingEditor><generator>Blogger</generator><openSearch:totalResults>562</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-1896933180365408857</guid><pubDate>Thu, 12 Feb 2015 11:45:00 +0000</pubDate><atom:updated>2015-02-12T06:45:42.280-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Powershell</category><title>Powershell to update multiple items with specific condition</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
Client wanted to restructure the data and wanted to update all the items in a list with particular value to a new value.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;
Quick PS script did the magic&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;cls

#Load SharePoint Snap In
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

function xUpdateAll-SPItems
{  
 param ($Url, $ListName,$ColumnName,$OldValue,$NewValue) 

$web = Get-SPWeb $Url 
$list = $web.Lists.TryGetList($ListName)

$items = $list.Items
foreach ($item in $items)
{
    $existingValue  = $item[$ColumnName]
    If($existingValue -eq $OldValue)
    {  
       Write-Host &quot;Updating item : &quot; + $item.ID      
     
        $item[$ColumnName] = $NewValue
        $item.Update()     
     }     
}  

 $web.Dispose()
 Write-Host &quot;Updated all items successfully&quot; -foregroundcolor Green  
 
}


#$url=Read-Host &quot;Enter site url&quot;
#$listName=Read-Host &quot;Enter list library name&quot;
#$columnName=Read-Host &quot;Enter column name&quot;
#$oldValue=Read-Host &quot;Enter old value&quot;
#$newValue=Read-Host &quot;Enter new value&quot;

$url=&quot;http://server:37788&quot;
$listName=&quot;mylist&quot;
$columnName=&quot;Column Name&quot;
$oldValue=&quot;Bad Value&quot;
$newValue=&quot;Other&quot;


xUpdateAll-SPItems $url $listName $columnName $oldValue $newValue

&lt;/pre&gt;&lt;strong&gt;Article:&lt;/strong&gt;</description><link>http://snahta.blogspot.com/2015/02/powershell-to-update-multiple-items.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-6760268353917522000</guid><pubDate>Tue, 27 May 2014 07:38:00 +0000</pubDate><atom:updated>2014-05-27T03:38:40.849-04:00</atom:updated><title>Search display templates not present on site collection</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;
When you configure a Search Result via CA, you might see the following error in the Preview panel:&lt;br /&gt;
&lt;br /&gt;
The Search display templates are not present on this site collection. To add them, you need to activate the &quot;Search Server Web Parts and Templates&quot; feature on the Site Collection Features page.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;
Open up the SharePoint 2013 Management Shell as Administrator and run the following command:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;Enable-SPFeature SearchWebParts -url http://central_admin_url&lt;/pre&gt;&lt;br /&gt;
</description><link>http://snahta.blogspot.com/2014/05/search-display-templates-not-present-on.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-3149112194727919852</guid><pubDate>Fri, 17 May 2013 08:38:00 +0000</pubDate><atom:updated>2013-05-30T02:17:52.815-04:00</atom:updated><title>SharePoint Powershell Create a new list with different column types</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
Murali ( my collegue ) was looking for a quick script to create a list using PS with diff columns types.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
PS - Love it - Google + little brain - recipe ready &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;clear
Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.SharePoint.Powershell
 
try 
{
 
$TestSiteUrl = &quot;http://extranet.contoso.com&quot; #provide site url in this variable
 
$ListName = &quot;KPIConfigList&quot;   #listName

$ListDescription = &quot;KPI config list&quot; #list description
 
$myTestWeb = Get-SPWeb -identity $TestSiteUrl   #Get web object
 
$listTemplate = [Microsoft.SharePoint.SPListTemplateType]::GenericList  #GenericList template
 
write-host &quot;Adding list&quot; $ListName
 

$myCustomList = $myTestWeb.Lists[$ListName]
 
if($myCustomList -eq $null) 
{
 
  $lstId = $myTestWeb.Lists.Add($ListName,$ListDescription,$listTemplate)
 
  $myCustomList = $myTestWeb.Lists[$ListName]
 
    #Add columns
 
    $spFieldType = [Microsoft.SharePoint.SPFieldType]::Text 

    $myCustomList.Fields.Add(&quot;TextField&quot;,$spFieldType,$false)

   #Add columns    
    $spFieldType = [Microsoft.SharePoint.SPFieldType]::Number 

    $myCustomList.Fields.Add(&quot;Order&quot;,$spFieldType,$false)

   #Add columns
    $spFieldType = [Microsoft.SharePoint.SPFieldType]::Boolean 

    $myCustomList.Fields.Add(&quot;IsDefault&quot;,$spFieldType,$false)

   #Add columns
    $choices = New-Object System.Collections.Specialized.StringCollection 

    $choices.Add(&quot;Client&quot;) 

    $choices.Add(&quot;Unit&quot;)

    $spFieldType = [Microsoft.SharePoint.SPFieldType]::Choice 

    $myCustomList.Fields.Add(&quot;Type&quot;,$spFieldType,$false,$false,$choices) 
     
    #Update
    $myCustomList.Update()
 
 write-host &quot;List created successfully&quot; $ListName
 
}
 
else
{ 
  write-host &quot;List already exists&quot; $ListName 
} 
}
 
catch
{ 
  write-host &quot;Error&quot; $_.exception
 
  $errorlabel = $true
 
}
 
finally
{
 
  if($myTestWeb -ne $null)
 {$myTestWeb.Dispose()}
 
  if($errorlabel -eq $true){exit 1}
 
  else {exit 0}
 
}exit 0
&lt;/pre&gt;&lt;strong&gt;Article:&lt;/strong&gt;&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-IN/library/microsoft.sharepoint.spfieldtype(v=office.12).aspx&quot; &gt; Other column types &lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blogs.technet.com/b/heyscriptingguy/archive/2010/09/22/use-powershell-to-manage-lists-views-and-items-in-sharepoint.aspx&quot;&gt; Powershell &lt;/a&gt;</description><link>http://snahta.blogspot.com/2013/05/sharepoint-powershell-create-new-list.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-1492549847576110766</guid><pubDate>Fri, 08 Mar 2013 05:40:00 +0000</pubDate><atom:updated>2013-03-08T00:40:20.782-05:00</atom:updated><title>SharePoint test user creation</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
We often need local test users, need to be created in Active Directory and also get them added to SharePoint site.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
Though of sharing what I use :)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;clear

$user = &quot;test.user1&quot;
$userWithDomain = &quot;contoso\&quot;+$user

Import-Module activedirectory
New-ADUser -Name $user -AccountPassword (ConvertTo-SecureString &quot;somepass&quot; -AsPlainText -force) -Enabled $True -PasswordNeverExpires $True -PassThru 


Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.SharePoint.Powershell

New-SPUser -UserAlias $userWithDomain -Web http://sp2010 -Group &quot;Team Owners&quot;
&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2013/03/sharepoint-test-user-creation.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-5173009942664221419</guid><pubDate>Thu, 07 Feb 2013 10:10:00 +0000</pubDate><atom:updated>2013-02-11T03:25:56.845-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Powershell</category><category domain="http://www.blogger.com/atom/ns#">Testing</category><title>Powershell Test Data for Record Center</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
Wanted to do a load test on Record Center with my custom solution. I wanted to have 100 record libraries with 100 folder each.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
Powershell script can do it in few minutes&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;clear
Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.SharePoint.Powershell

[Void][System.Diagnostics.Stopwatch] $sw;
# New Stopwatch object
$sw = New-Object System.Diagnostics.StopWatch;
# Stop any watches that might be running
$sw.Stop();                                         
$sw.Start();

# Initialization
$webUrl = &#39;http://recordcenter&#39;
$libCount = 1;
$folderCount = 1;
$libraryName = &quot;Record Library&quot; + $libCount
$frontSlash = &quot;/&quot;
$web = Get-SPWeb $webUrl;
$listTemplate = $web.ListTemplates | Where-Object {$_.Name -eq &quot;Record Library&quot;}
#Create folders 
(1..100)|%{
      $libraryName = &quot;Contract Library&quot; + $libCount                         
      write-host &quot;Creating Record library: &quot; $libraryName                                      
      $web.Lists.Add($libraryName,&quot;Record Library&quot;,$listTemplate);
       $libCount  = $libCount + 1;
       [string]$howlong0 = $sw.Elapsed.ToString();  # How long
       Write-Host &quot;Library Ready (Time ): &quot; $howlong0 -F Green;
        $spDocumentLibrary = $web.Lists.TryGetList($libraryName)
                    (1..1000)|%{
                    write-host &quot;Adding Folder in library: &quot; $libraryName
                    $folderName = &quot;Folder&quot; + $folderCount
                 $spFolder = $spDocumentLibrary.AddItem(&quot;&quot;,[Microsoft.SharePoint.SPFileSystemObjectType]::Folder,$folderName) 
                 $spFolder.Update()
                    $folderCount = $folderCount+1
                   [string]$howlong0 = $sw.Elapsed.ToString();  # How long
                    Write-Host &quot;Folder Ready (Time ): &quot; $howlong0 -F Green;
                    }
}

$web.Dispose()
$sw.Stop();    # Stop the timer
[string]$howlong = $sw.Elapsed.ToString();   # How long
write-host &quot;Done (Time ): &quot; $howlong -F Green;&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2013/02/powershell-test-data-for-record-center.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-4885401967847443078</guid><pubDate>Sun, 03 Feb 2013 16:33:00 +0000</pubDate><atom:updated>2013-02-03T12:22:01.052-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PopUp</category><title>SharePoint popup how to</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;
I planned to use SharePoint popup in client project. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;
I did a quick POC and here&#39;s what you need to do to make it work.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;What goes in Parent Window Header ?&lt;/strong&gt;&lt;br /&gt;
Add following JavaScript in the header section :&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;function OpenMyWebPage(popupTitle, popupUrl) {
        var options = {
            url: popupUrl,
            autoSize: true,
            showClose: true,
            title: popupTitle,
            dialogReturnValueCallback: function (dialogResult) {
                if (dialogResult == SP.UI.DialogResult.OK) {
                    window.document.location.reload(true);
                }
            }
        };
        SP.UI.ModalDialog.showModalDialog(options);
    }&lt;/pre&gt;&lt;strong&gt;How to launch the Popup&lt;/strong&gt;&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; id=&quot;lnkEdit&quot; onclick=&quot;OpenMyWebPage(&#39;Title&#39;,&#39;/SiteAssets/PopupPage.aspx&#39;);return false&quot;&gt;Edit&lt;/a&gt;&lt;/pre&gt;&lt;strong&gt;What goes in Popup Window&lt;/strong&gt; - Save button at the end ( to refresh the parent window )&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;Context.Response.Write(&quot;&amp;lt;script type=&#39;text/javascript&#39;&amp;gt;window.frameElement.commitPopup();&amp;lt;/script&amp;gt;&quot;);
           Context.Response.Flush();
           Context.Response.End();&lt;/pre&gt;&lt;strong&gt;What goes in Popup Window&lt;/strong&gt; - Cancel button&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;Nothing is needed here&lt;/pre&gt;&lt;strong&gt;Hidding Ribbon&lt;/strong&gt; - Add at the end , in case you dont want to display ribbon&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;&lt;style type=&quot;text/css&quot;&gt;
    /* Hide the ribbon */
    #s4-ribbonrow
    {
        display: none;
    }
&lt;/style&gt;&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2013/02/sharepoint-popup-how-to.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-4743905587603910758</guid><pubDate>Sat, 26 Jan 2013 20:14:00 +0000</pubDate><atom:updated>2013-01-26T15:14:57.157-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Powershell</category><title>Power-shell to check-in files</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
During bulk migration, lot of files left checked out because of lack of metadata. We wanted to check-in all these files. Also we want to restrict the script to only &quot;Record Libraries&quot; in record center.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt;  &lt;br /&gt;
Power-shell &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.SharePoint.Powershell

$rand = new-object System.Random

function CheckInDocument([string]$url)
{

$spWeb = Get-SPWeb $url
$SPBaseTypeDocumentLibrary = [Microsoft.SharePoint.SPBaseType]::DocumentLibrary
$lists = $spWeb.GetListsOfType($SPBaseTypeDocumentLibrary);

foreach ($list in $lists)
{
    if ($list.Hidden -eq $False -and $list.BaseTemplate.ToString() -eq &quot;1302&quot;)
    {
        Write-Host Checking in documents from Library : $list.Title
        $getFolder = $spWeb.GetFolder($list.Title)
        $files = $list.CheckedOutFiles

        write-host &quot;Total Checked Out Files : &quot; $files.Count

        $list.CheckedOutFiles | Where { $_.CheckOutStatus -ne &quot;None&quot; } |
        ForEach {
            $_.TakeOverCheckOut();
            #$docItem = $list.GetItemById($_.ListItemId);
            #$docItem[&quot;Field To Update&quot;] = &quot;Some value&quot;;
            $docItem.SystemUpdate();                    
            $docItem.File.CheckIn(&quot;Checked In By Administrator&quot;);
            Write-Host &quot;$($docItem.File.Name) Checked In&quot; -ForeGroundColor Green

            }
    }
}

$spWeb.Dispose()


}

CheckInDocument http://sp2010&lt;/pre&gt;&lt;strong&gt;Article:&lt;/strong&gt;</description><link>http://snahta.blogspot.com/2013/01/power-shell-to-check-in-files.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-4327649873900659088</guid><pubDate>Sat, 26 Jan 2013 18:35:00 +0000</pubDate><atom:updated>2013-02-06T11:59:52.025-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Deployment</category><category domain="http://www.blogger.com/atom/ns#">Powershell</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Refresh GAC using Powershell</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;
Refreshing GAC is always a painful thing. &lt;br /&gt;
Do IISReset / remove old stuff / put new one. Can we automate it ? &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;
Certainly.. mighty power-shell can do it easily&lt;br /&gt;
&lt;br /&gt;
If you are running on new machine - you might need to relax executing policy &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;Set-ExecutionPolicy Unrestricted&lt;/pre&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;iisreset /stop

Set-Alias Gacutil &quot;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe&quot;

Gacutil /uf EntLibContrib.Data.OdpNet
Gacutil /i &quot;MS ENT dlls\EntLibContrib.Data.OdpNet.dll&quot;

Gacutil /uf Microsoft.Practices.EnterpriseLibrary.Caching
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.EnterpriseLibrary.Caching.dll&quot;

Gacutil /uf Microsoft.Practices.EnterpriseLibrary.Common
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.EnterpriseLibrary.Common.dll&quot;

Gacutil /uf Microsoft.Practices.EnterpriseLibrary.Data
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.EnterpriseLibrary.Data.dll&quot;

Gacutil /uf Microsoft.Practices.EnterpriseLibrary.Logging
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.EnterpriseLibrary.Logging.dll&quot;

Gacutil /uf Microsoft.Practices.ServiceLocation
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.ServiceLocation.dll&quot;

Gacutil /uf Microsoft.Practices.Unity.Configuration
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.Unity.Configuration.dll&quot;

Gacutil /uf Microsoft.Practices.Unity
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.Unity.dll&quot; 

Gacutil /uf Microsoft.Practices.Unity.Interception.Configuration
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.Unity.Interception.Configuration.dll&quot;

Gacutil /uf Microsoft.Practices.Unity.Interception
Gacutil /i &quot;MS ENT dlls\Microsoft.Practices.Unity.Interception.dll&quot; 

Gacutil /uf Telerik.Web.Design
Gacutil /i &quot;Telerik.Web.Design.dll&quot;

Gacutil /uf Telerik.Web.UI
Gacutil /i &quot;Telerik\Telerik.Web.UI.dll&quot; 

Gacutil /uf Telerik.Reporting
Gacutil /i &quot;Telerik\Telerik.Reporting.dll&quot;

Gacutil /uf Telerik.Web.UI.Skins
Gacutil /i &quot;Telerik\Telerik.Web.UI.Skins.dll&quot;

iisreset /start

&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2013/01/refresh-gac-using-powershell.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-1467702849128800273</guid><pubDate>Tue, 15 Jan 2013 06:32:00 +0000</pubDate><atom:updated>2013-01-26T13:31:54.604-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">Security</category><title>Event receiver with Elevated Privileged</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;
Client wanted to run the event receiver code with elevated access.  &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;
Using Elevated Privileged is one option but better options was using System User Token&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;/// &lt;summary&gt;
        /// An item is being added.
        /// &lt;/summary&gt;
        public override void ItemAdding(SPItemEventProperties properties)
        {
            SPSite site = properties.Web.Site;
            SPUserToken sysToken = site.SystemAccount.UserToken;
            site.Dispose();

            using (var systemSite = new SPSite(properties.SiteId, sysToken))
            {
                using (SPWeb sysWeb = systemSite.OpenWeb(properties.Web.ID))
                {
                       // Code goes here 
                }
            }&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2013/01/event-receiver-with-elevated-privileged.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-2873274893530589054</guid><pubDate>Fri, 14 Dec 2012 07:48:00 +0000</pubDate><atom:updated>2012-12-26T04:08:46.277-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Powershell</category><title>Powershell to hide fields from edit form</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;
We build a small solution for our client. &lt;br /&gt;
Solution had a custom UI for all CRUD operations and client want to block everyone from editing the list using Edit Form. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
While there can be many ways, considering site is running perfectly in PROD, writing a quick power shell will be enough. &lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;&quot; alt=&quot;&quot; /&gt; &lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;cls
Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.SharePoint.Powershell

$webUrl = &quot;http://sp2010/siteX&quot;
$web = Get-SPWeb $webUrl
$list = $web.Lists.TryGetList(&quot;Tasks&quot;)

$fieldDisplayNames = &quot;Status&quot;,&quot;Priority&quot;
$showFields = $false 

$fieldDisplayNames |foreach {
 
$spfield = $list.Fields[$_]
$spfield.ShowInEditForm = $showFields
$spfield.Update()

}&lt;/pre&gt;&lt;strong&gt;Article:&lt;/strong&gt;</description><link>http://snahta.blogspot.com/2012/12/powershell-to-hide-fields-from-edit-form.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-5176626601902546280</guid><pubDate>Fri, 21 Sep 2012 15:43:00 +0000</pubDate><atom:updated>2013-01-26T13:36:56.865-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Claims</category><category domain="http://www.blogger.com/atom/ns#">Powershell</category><title>SharePoint programatically apply claims</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
Claim based authentication is way to go if you want to have dynamic roles for user based on certain attribute of an item/document. But question is how to apply a claim to the item :)&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;
Sample code &lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration.Claims;

namespace SKN
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 0;
            using (SPSite site = new SPSite(&quot;http://intranet/Sites/LoadTest&quot;))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPList list = web.Lists.TryGetList(&quot;Shared Documents&quot;);
                    SPView view = list.Views[&quot;Missing Claims&quot;];
                    SPQuery query = new SPQuery(view);
                   
                    foreach (SPListItem item in list.GetItems(query))
                    {
                        i = item.ID;
ApplyClaims(web, item, true, &quot;0000&quot; + item.ID.ToString(), true,&quot;Myclient&quot;);
                    }
                }
            }

            Console.Write(i);
            Console.ReadKey();
        }

        /// &lt;summary&gt;
        /// Applies claims to the item.
        /// &lt;/summary&gt;
public static void ApplyClaims(SPWeb web, SPListItem item,string claimValue , string client)
        {
            item.BreakRoleInheritance(false);

            SPClaimProviderManager claimMgr = SPClaimProviderManager.Local;
            if (claimMgr != null)
            {
               SPClaim claim = new                               SPClaim(Microsoft.IdentityModel.Claims.ClaimTypes.Role,
               claimValue,
Microsoft.IdentityModel.Claims.ClaimValueTypes.String,
SPOriginalIssuers.Format(SPOriginalIssuerType.TrustedProvider, client));

                string userName = claimMgr.EncodeClaim(claim);

                // SPUser spUser = web.EnsureUser(userName);
                SPUserInfo info = new SPUserInfo
                {
                    LoginName = userName,
                    Name = claimValue 
                };

                SPRoleAssignment roleAssignmentClaim = new SPRoleAssignment(info.LoginName, info.Email, info.Name, info.Notes);
                roleAssignmentClaim.RoleDefinitionBindings.Add(web.RoleDefinitions[&quot;Read&quot;]);
                item.RoleAssignments.Add(roleAssignmentClaim);
            }
        }

        /// &lt;summary&gt;
        /// Adds the role assignment.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;item&quot;&gt;The item.&lt;/param&gt;/// &lt;param name=&quot;roleAssignment&quot;&gt;The role assignment.&lt;/param&gt;public static void AddRoleAssignment(SPListItem item, SPRoleAssignment roleAssignment)
        {
            bool isNotFound = true;
            foreach (SPRoleAssignment roleAssign in item.RoleAssignments)
            {
                if (roleAssign.Equals(roleAssignment))
                {
                    isNotFound = false;
                    break;
                }
            }

            if (isNotFound)
            {
                item.RoleAssignments.Add(roleAssignment);
            }

            item.SystemUpdate();
        }
    }
}
&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2012/09/sharepoint-programatically-apply-claims.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-4873083831191996122</guid><pubDate>Fri, 14 Sep 2012 07:29:00 +0000</pubDate><atom:updated>2012-09-14T03:30:24.906-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Powershell</category><category domain="http://www.blogger.com/atom/ns#">Testing</category><title>SharePoint Powershell Test Data script</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;
Working on a project and we need to test the software limit of SharePoint 2010.&lt;br /&gt;
MS Documentation is not clear about things/ community blogs have different experience.&lt;br /&gt;
So without taking chance, here a small script to create test items &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;
Powershell script&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;cls
Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
Add-PSSnapin Microsoft.SharePoint.Powershell

$webUrl = Read-Host &#39;Please specify site url&#39;
$web = Get-SPWeb $webUrl;
$list = $web.Lists.TryGetList(&quot;Announcements&quot;);
(1..50000)|%{
$item = $list.Items.Add();
$item[&quot;Title&quot;]=&quot;Test&quot;;
$item.Update();
# Optional 
# $item.BreakRoleInheritance($True);
$item.ID
}
$web.Dispose()&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2012/09/sharepoint-powershell-test-data-script.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-9168410253593698967</guid><pubDate>Wed, 05 Sep 2012 05:40:00 +0000</pubDate><atom:updated>2012-09-05T01:41:50.418-04:00</atom:updated><title>Cannot start the conversion job because it does not contain any files.</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
While working with a small POC. I encountered a weird error.&lt;br /&gt;
Cannot start the conversion job because it does not contain any files.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
Error was coming when I was trying to convert all files of a document library from word to pdf. &lt;br /&gt;
&lt;br /&gt;
I googled the error - but no luck , so thought of posting once I found the fix.&lt;br /&gt;
&lt;br /&gt;
I read error and as per the message there are no files in the library.&lt;br /&gt;
I validated and there were files in there. So what could be it :)&lt;br /&gt;
&lt;br /&gt;
Permission. &lt;br /&gt;
I checked the account running the Word Automation Service and gave &quot;Contribute&quot; access the account. That was it.&lt;br /&gt;
</description><link>http://snahta.blogspot.com/2012/09/cannot-start-conversion-job-because-it.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-5776716952643721834</guid><pubDate>Sun, 26 Aug 2012 11:39:00 +0000</pubDate><atom:updated>2014-06-23T12:19:40.717-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Claims</category><title>Quickly identifying claim based site</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
I love user group as you get question from every angle. I got a very simple question from one of the user. How do I know my site is already configured for claims ? &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
If you login to your site and click on My Settings from Welcome menu , you will see clean Account name , with no weird characters :)&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;https://bdjkzq.by3301.livefilestore.com/y2ptggVWCGAiJR5k5Cf-2NA9c_nRBA4NxZsPzm3V8-7N1AOQkCzr1HMNMm_UJsnoK_zZUjQJwdwGxJdE2vGIbt6dMthUIN1F3_DDUQBp1WdvkQ/NonClaims.PNG?psid=1&quot;&gt;&lt;/img&gt;&lt;br /&gt;
&lt;br /&gt;
If claims is enabled you will see something like this. Notice those weird characters as prefix to account name.&lt;br /&gt;
&lt;img src=&quot;https://p9goqq.by3301.livefilestore.com/y2peO5q1AgOeD0IctJ-kbJfUjpNs0u56q8uDOowDUJeMEM2R6v5hodDoGxSOxt8NB3Bp5BTojACEjPYTM5rZjTvNggLLsMCx6Tv_0C1_CxHRAc/ClaimsBased.PNG?psid=1&quot;&gt;&lt;/img&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Article:&lt;/strong&gt;&lt;br /&gt;
In case you want to switch from Classic &gt; Claims based or vice-versa, you can use my old article &lt;a href=&#39;http://snahta.blogspot.in/2010/06/enable-claim-based-authentication-for.html&#39;&gt;Enable Claim Based Authentication for existing web application&lt;/a&gt;</description><link>http://snahta.blogspot.com/2012/08/quickly-identifying-claim-based-site.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-4738293686956463083</guid><pubDate>Thu, 23 Aug 2012 14:26:00 +0000</pubDate><atom:updated>2012-08-26T07:48:24.526-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CSV</category><category domain="http://www.blogger.com/atom/ns#">Powershell</category><category domain="http://www.blogger.com/atom/ns#">User Profile</category><title>Powershell exporting user profile information</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;
I was asked by my client to export User Profile data into Excel.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
Answer was Powershell. I googled and found a good script to start with, I just added few more things and tested it. Here&#39;s the script&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$siteUrl = &quot;http://sp2010&quot;
$outputFile = &quot;C:\UserProfiles.csv&quot;

$serviceContext = Get-SPServiceContext -Site $siteUrl
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serviceContext);
$profiles = $profileManager.GetEnumerator()

Write-Host &quot;Exporting profiles&quot; 

$collection = @()
foreach ($profile in $profiles) {
 
  $profileData = &quot;&quot; | select &quot;AccountName&quot;,&quot;FirstName&quot;, &quot;LastName&quot;,&quot;PreferredName&quot;,&quot;WorkPhone&quot;
   $profileData.AccountName = $profile[&quot;AccountName&quot;].Value
   $profileData.FirstName = $profile[&quot;FirstName&quot;].Value
   $profileData.LastName = $profile[&quot;LastName&quot;].Value
   $profileData.PreferredName = $profile[&quot;PreferredName&quot;].Value
   $profileData.WorkPhone = $profile[&quot;WorkPhone&quot;].Value
   $collection += $profileData
}

$collection | Export-Csv $outputFile -NoTypeInformation&lt;/pre&gt;&lt;strong&gt;Article:&lt;/strong&gt;&lt;br /&gt;
&lt;a href=&#39;http://csefi.blogspot.in/2012/02/sharepoint-2010-user-profile-export-to.html&#39;&gt;User Profile export &lt;/a&gt;</description><link>http://snahta.blogspot.com/2012/08/powershell-exporting-user-profile.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-8432127892652543485</guid><pubDate>Tue, 14 Aug 2012 14:17:00 +0000</pubDate><atom:updated>2012-08-14T10:19:22.729-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.Net</category><title>ASP.Net Dynamic controls missing after postback</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;
One of the fresher on my team had trouble with dynamic controls. Controls were added during a button click and were missing from UI as soon as another button is clicked on the page ( basically any other post back happens )&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
Actually its by design, once page post back happens , data is saved in viewstate for dynamic controls also but dynamic controls will not be repainted. You will have to recreate in Page_Init or Page_Load.Here&#39;s a small sample which works.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;br /&gt;
&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;using System;
using System.Web.UI.WebControls;

namespace SKN.TestDynamicControl{   

public partial class _Default : System.Web.UI.Page    
{        public int controlCount
        {
            get
            {
                if (null != ViewState[&quot;controlcount&quot;])
                {
                    return (int)ViewState[&quot;controlcount&quot;];
                }
                else
                {
                    return 0;
                }
            }
            set
            {
                if (null != ViewState[&quot;controlcount&quot;])
                {
                    ViewState[&quot;controlcount&quot;] = value;
                }
                else
                {                    ViewState.Add(&quot;controlcount&quot;, value);
                }
            }
        }        
        protected void Page_Load(object sender, EventArgs e)
        {
            for (int i = 0; i &amp;lt; controlcount; i++)
            {
                TextBox txt = new TextBox();
                txt.ID = &quot;txt&quot; + i;
                txt.Text = &quot;Text&quot; + i;
                pnlPlace.Controls.Add(txt);
            }
        }
        
        protected void Button1_Click(object sender, EventArgs e)
        {
            controlcount = 5;
            for (int i = 0; i &amp;lt; controlcount; i++)
            {
                TextBox txt = new TextBox();
                txt.ID = &quot;txt&quot; + i;
                txt.Text = &quot;Text&quot; + i;
                pnlPlace.Controls.Add(txt);
            }
        }
        protected void btnAdd_Click(object sender, EventArgs e)       {            
            string values = string.Empty;
            foreach (var item in pnlPlace.Controls)
            {
               if (item is TextBox)
               {
                    values += &quot;,&quot; + (item as TextBox).Text;
                }
            }
            Response.Write(values);
        }
    }
}&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2012/08/aspnet-dynamic-controls-missing-after.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-8403278887385609099</guid><pubDate>Mon, 02 Jul 2012 09:46:00 +0000</pubDate><atom:updated>2012-08-26T07:49:35.167-04:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Branding</category><title>SharePoint sub site branding fix</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
Wanted to blog this long back - but :) &lt;br /&gt;
At times, SharePoint is very weird. Here&#39;s a situation. Client have customer master page , he applied to Root Site and also check the option to apply it to all the sub-sites. All good so far. &lt;br /&gt;
No what if client create a new sub-site in future. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
Created a new feature to bridge the gap and also creates a new feature to ensure that this feature get activated on all the newly created sub-sites. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Steps / Code:&lt;/strong&gt; &lt;br /&gt;
1. Create a new feature ( Branding_Sync / Scope = Web ) &lt;br /&gt;
2. Add a feature receiver with following code on activation &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;csharp&quot;&gt;public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            SPWeb web = properties.Feature.Parent as SPWeb;

            if (!web.IsRootWeb)
            {
                Hashtable hash = web.AllProperties;
                web.MasterUrl = web.ParentWeb.MasterUrl;
                hash[&quot;__InheritsMasterUrl&quot;] = &quot;True&quot;;
                web.CustomMasterUrl = web.ParentWeb.CustomMasterUrl;
                web.SiteLogoUrl = web.ParentWeb.SiteLogoUrl;
                hash[&quot;__InheritsCustomMasterUrl&quot;] = &quot;True&quot;;
                web.Update();
            }
        }&lt;/pre&gt;3. Create a new feature ( Feature2 / Scope = Web Application ) &lt;br /&gt;
4. Add a new &quot;Empty Element&quot; manifest and paste following lines &lt;br /&gt;
5. Replace the &quot;FeatureGUID&quot; with the guid of Feature1 above &lt;br /&gt;
&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;Elements xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;STS#0&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;STS#1&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;STS#2&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;WIKI#0&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;BLOG#0&quot; /&amp;gt;

  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;MPS#0&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;MPS#1&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;MPS#2&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;MPS#3&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;MPS#4&quot; /&amp;gt;

  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;SRCHCENTERLITE#0&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;SRCHCENTERLITE#1&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;BDR#0&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;OFFILE#0&quot; /&amp;gt;
  &amp;lt;FeatureSiteTemplateAssociation Id=&quot;FeatureGUID&quot; TemplateName=&quot;SPSREPORTCENTER#0&quot; /&amp;gt;
&amp;lt;/Elements&amp;gt;&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2012/07/sharepoint-sub-site-branding-fix.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-1698094098797788864</guid><pubDate>Fri, 15 Jun 2012 08:15:00 +0000</pubDate><atom:updated>2013-01-26T13:37:40.683-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Administration</category><title>SharePoint Logs controlling file size</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; While we are waiting for new version of SharePoint, I still find developers/admin&#39;s missing out some great features of SharePoint 2010. Here&#39;s one, I got 2 new VM pre-configured and they run out of space every second day.  &lt;br /&gt;
&lt;br /&gt;
Reason : SharePoint logs  &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; In SP2010 , new feature was introduced to control logging size &quot;Restrict log disk space usage&quot;  &lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;log&quot; src=&quot;https://public.blu.livefilestore.com/y1p0VUKm7DSqfxkWlP0xkh7Qe9iP7PlzjIutJOKYmgu5l1i9WKJqyUMZyilm7THGECzxRmZsUvapOWLWf99C27J7g/LoggingSettings.PNG?psid=1&quot; /&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Article:&lt;/strong&gt; &lt;a href=&quot;http://technet.microsoft.com/en-us/library/ee748656.aspx&quot;&gt;Configure diagnostic logging (SharePoint Server 2010)&lt;/a&gt;</description><link>http://snahta.blogspot.com/2012/06/sharepoint-logs-controlling-file-size.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-6460617111538072695</guid><pubDate>Fri, 20 Apr 2012 13:38:00 +0000</pubDate><atom:updated>2013-01-26T13:38:49.864-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Javascript</category><title>JavaScript and Date Time formatting</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; Working with SP client object model , I was getting formatted date string. Not very good for display purpose.&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; I asked our in house JavaScript expert sanjay and got a kick start , here&#39;s a little bit modified version of that outputting UTC date time. &lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;//function for the getting the formatted date and time 
// current output April 20, 2012 7:04 PM
function formattedUTCDateTime(d) {

    // code for the year
    var m_names = new Array(&quot;January&quot;, &quot;February&quot;, &quot;March&quot;,
    &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;August&quot;, &quot;September&quot;,
    &quot;October&quot;, &quot;November&quot;, &quot;December&quot;);

//    var d = new Date();
    var curr_date = d.getUTCDate();
    var sup = &quot;&quot;;
    if (curr_date == 1 || curr_date == 21 || curr_date == 31) {
        sup = &quot;st&quot;;
    }
    else if (curr_date == 2 || curr_date == 22) {
        sup = &quot;nd&quot;;
    }
    else if (curr_date == 3 || curr_date == 23) {
        sup = &quot;rd&quot;;
    }
    else {
        sup = &quot;th&quot;;
    }

    var curr_month = d.getUTCMonth();
    var curr_year = d.getUTCFullYear();

    //code for the time    
    var hours = d.getUTCHours()
    var minutes = d.getUTCMinutes()

    var suffix = &quot;AM&quot;;
    if (hours &gt;= 12) {
        suffix = &quot;PM&quot;;
        hours = hours - 12;
    }
    if (hours == 0) {
        hours = 12;
    }

    if (minutes &lt; 10)
        minutes = &quot;0&quot; + minutes;

    var datetimevalue = (m_names[curr_month] + &quot; &quot; + curr_date + &quot;, &quot; + curr_year + &quot;  &quot; + hours + &quot;:&quot; + minutes + &quot; &quot; + suffix);
    return datetimevalue;

}&lt;/pre&gt;
</description><link>http://snahta.blogspot.com/2012/04/scenario-working-with-sp-client-object.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-6572625844060716031</guid><pubDate>Fri, 06 Apr 2012 08:27:00 +0000</pubDate><atom:updated>2013-01-26T13:39:21.380-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Error</category><title>SharePoint Resource file issues</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
Working on some of the recent projects I faced some weird Resource file based issues.  Actually these errors shows up during Feature activation. So doing a quick post on workarounds that worked for me.Leave comments if you found a more appropriate answer &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Error type (1):&lt;/strong&gt; &lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Failed to read resource file &quot;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\myProject_SiteFeature\Resources\Resources.en-US.resx&quot; from feature id &quot;GUID&quot;. &lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Failed to open the file &#39;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\myProject_SiteFeature\Resources\Resources.en-US.resx&#39;.&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;What I did:&lt;/strong&gt; After googling  / investigating my logs with Error co-relation ID , I realized that these can be skipped. Real cause of this error is something else and will recommend to start analyzing the logs from oldest to newest. Doing so I was able to find the real cause of the issue. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Error type (2):&lt;/strong&gt; &lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Failed to find resource file &quot;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Resources\myProjectResources.en-US.resx&quot; from feature id &quot;GUID&quot;.&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;What I did:&lt;/strong&gt; In my project I was using &quot;myProjectResources.resx&quot; file but it was looking for &quot;myProjectResources.en-US.resx&quot;, which is weird. To fix the issue, I create a copy of existing &quot;myProjectResources.resx&quot; file and redeployed. It worked for me.</description><link>http://snahta.blogspot.com/2012/04/sharepoint-resource-file-issues.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-6351579992434658652</guid><pubDate>Thu, 01 Mar 2012 10:56:00 +0000</pubDate><atom:updated>2013-01-26T13:39:45.024-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Code</category><category domain="http://www.blogger.com/atom/ns#">Powershell</category><title>SharePoint Powershell List Items</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; SharePoint automation scripts related to list items. &lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt; &lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;#Load SharePoint Snap In
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;function xApproveAll-SPItems
{  
 param ($Url, $ListName) 

$web = Get-SPWeb $Url 
$list = $web.Lists.TryGetList($ListName)

$folders = $list.Folders
foreach ($folder in $folders)
{
     $folder[&quot;_ModerationStatus&quot;] = 0
     $folder.Update()
}  

$items = $list.Items
foreach ($item in $items)
{
     Write-Host &quot;Approving : &quot; + $intIndex 
     $item[&quot;_ModerationStatus&quot;] = 0
     $item.Update()
}  

 $web.Dispose()
 Write-Host &quot;Approved all the documents successfully&quot; -foregroundcolor Green  
}

function xDeleteAll-SPItems
{  
 param ($Url, $ListName) 

$web = Get-SPWeb $Url
$list = $web.Lists.TryGetList($ListName)
$itemCount = $list.ItemCount
for($intIndex = $itemCount; $intIndex -gt 0; $intIndex--) 
{ 
        Write-Host &quot;Deleting : &quot; + $intIndex 
        $list.Items[$intIndex-1].Delete();
}

 $web.Dispose()

}&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;$url=Read-Host &quot;Enter site url&quot;
$listName=Read-Host &quot;Enter list library name&quot;

xApproveAll-SPItems $url $listName
xDeleteAll-SPItems $url $listName&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2012/03/sharepoint-powershell-list-items.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-8390752973930204530</guid><pubDate>Tue, 28 Feb 2012 21:18:00 +0000</pubDate><atom:updated>2013-01-26T13:39:56.357-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Powershell</category><category domain="http://www.blogger.com/atom/ns#">Security</category><title>Powershell and SharePoint Permissions</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; SharePoint provide options to have security at different level, here some related functions which you can use. &lt;br /&gt;
&lt;strong&gt;Code:&lt;/strong&gt; &lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;#Load SharePoint Snap In
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;function Create-SPGroupInWeb
{
 param ($Url, $GroupName, $PermissionLevel, $Description)
 $web = Get-SPWeb -Identity $Url
 if ($web.SiteGroups[$GroupName] -ne $null)
 {
  Write-Host &quot;Group $GroupName already exists!&quot; -foregroundcolor Red
 }
 else
 {
  $web.SiteGroups.Add($GroupName, $web.Site.Owner, $web.Site.Owner, $Description)
  $group = $web.SiteGroups[$GroupName]
  $roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment($group)
  $roleDefinition = $web.Site.RootWeb.RoleDefinitions[$PermissionLevel]
  $roleAssignment.RoleDefinitionBindings.Add($roleDefinition)
  $web.RoleAssignments.Add($roleAssignment)
  $web.Update()
  Write-Host &quot;Group $GroupName created successfully&quot; -foregroundcolor Green
 }

 $web.Dispose()
}&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;function Remove-SPPermisssionFromListGroup
{
 param ($Url, $ListName, $GroupName, $PermissionLevel)
 $web = Get-SPWeb -Identity $Url
 $list = $web.Lists.TryGetList($ListName)
 if ($list -ne $null)
 {
  if ($list.HasUniqueRoleAssignments -eq $False)
  {
   $list.BreakRoleInheritance($True)
  }
  else
  {
   if ($web.SiteGroups[$GroupName] -ne $null)
   {
    $group = $web.SiteGroups[$GroupName]
    $roleAssign = $list.RoleAssignments.GetAssignmentByPrincipal($group);
    $roleDefinition = $web.RoleDefinitions[$PermissionLevel];
    $roleAssign.RoleDefinitionBindings.Remove($roleDefinition);
    $roleAssign.Update();
    $list.Update();
    Write-Host &quot;Successfully removed $PermissionLevel permission from $GroupName group in $ListName list.&quot; -foregroundcolor Green
   }
   else
   {
    Write-Host &quot;Group $GroupName does not exist.&quot; -foregroundcolor Red
   }
  }
 }
 else
 {
  Write-Host &quot;List $ListName does not exist!&quot; -foregroundcolor Red
 }

 $web.Dispose()
}&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;function Add-SPPermissionToListGroup
{
 param ($Url, $ListName, $GroupName, $PermissionLevel)
 $web = Get-SPWeb -Identity $Url
 $list = $web.Lists.TryGetList($ListName)
 if ($list -ne $null)
 {
  if ($list.HasUniqueRoleAssignments -eq $False)
  {
   $list.BreakRoleInheritance($True)
  }
  else
  {
   if ($web.SiteGroups[$GroupName] -ne $null)
   {
    $group = $web.SiteGroups[$GroupName]
    $roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment($group)
    $roleDefinition = $web.RoleDefinitions[$PermissionLevel];
    $roleAssignment.RoleDefinitionBindings.Add($roleDefinition);
    $list.RoleAssignments.Add($roleAssignment)
    $list.Update();
    Write-Host &quot;Successfully added $PermissionLevel permission to $GroupName group in $ListName list. &quot; -foregroundcolor Green
   }
   else
   {
    Write-Host &quot;Group $GroupName does not exist.&quot; -foregroundcolor Red
   }
  }
 }

 $web.Dispose()
}&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;function Remove-SPPermisssionFromListItemGroupSpecific
{
 param ($Url, $ListName, $GroupName, $PermissionLevel)
 $web = Get-SPWeb -Identity $Url
 $list = $web.Lists.TryGetList($ListName)
 if ($list -ne $null)
 {
  foreach ($item in $list.Items) 
  {
   if ($item.HasUniqueRoleAssignments -eq $False)
   {
    $item.BreakRoleInheritance($True)
   }
   else
   {
    if ($web.SiteGroups[$GroupName] -ne $null)
    {
     $group = $web.SiteGroups[$GroupName]
     $roleAssign = $item.RoleAssignments.GetAssignmentByPrincipal($group);
     $roleDefinition = $web.RoleDefinitions[$PermissionLevel];
     $roleAssign.RoleDefinitionBindings.Remove($roleDefinition);
     $roleAssign.Update();
     $item.SystemUpdate();                    
     Write-Host &quot;Successfully removed $PermissionLevel permission from $GroupName group in $ListName list.&quot; -foregroundcolor Green
    }
    else
    {
     Write-Host &quot;Group $GroupName does not exist.&quot; -foregroundcolor Red
    }
   }
  }
 }
 else
 {
  Write-Host &quot;List $ListName does not exist!&quot; -foregroundcolor Red
 }

 $web.Dispose()
}&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;function Remove-SPPermisssionFromListItemGroupAll
{
 param ($Url, $ListName, $GroupName)
 $web = Get-SPWeb -Identity $Url
 $list = $web.Lists.TryGetList($ListName)
 if ($list -ne $null)
 {
  foreach ($item in $list.Items) 
  {
   if ($item.HasUniqueRoleAssignments -eq $False)
   {
    $item.BreakRoleInheritance($True)
   }
   else
   {
    if ($web.SiteGroups[$GroupName] -ne $null)
    {
     $group = $web.SiteGroups[$GroupName]
                    $item.RoleAssignments.Remove($group)
     $item.SystemUpdate();                    
     Write-Host &quot;Successfully removed $PermissionLevel permission from $GroupName group in $ListName list.&quot; -foregroundcolor Green
    }
    else
    {
     Write-Host &quot;Group $GroupName does not exist.&quot; -foregroundcolor Red
    }
   }
  }
 }
 else
 {
  Write-Host &quot;List $ListName does not exist!&quot; -foregroundcolor Red
 }

 $web.Dispose()
}&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;function Add-SPPermissionToListItemGroup
{
 param ($Url, $ListName, $GroupName, $PermissionLevel)
 $web = Get-SPWeb -Identity $Url
 $list = $web.Lists.TryGetList($ListName)
 if ($list -ne $null)
 {
  foreach ($item in $list.Items) 
  {
   if ($item.HasUniqueRoleAssignments -eq $False)
   {
    $item.BreakRoleInheritance($True)
   }
   else
   {
    if ($web.SiteGroups[$GroupName] -ne $null)
    {
     $group = $web.SiteGroups[$GroupName]
     $roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment($group)
     $roleDefinition = $web.RoleDefinitions[$PermissionLevel];
     $roleAssignment.RoleDefinitionBindings.Add($roleDefinition);
     $item.RoleAssignments.Add($roleAssignment)
     $item.SystemUpdate();
     Write-Host &quot;Successfully added $PermissionLevel permission to $GroupName group in $ListName list. &quot; -foregroundcolor Green
    }
    else
    {
     Write-Host &quot;Group $GroupName does not exist.&quot; -foregroundcolor Red
    }
   }
  }
 }

 $web.Dispose()
}&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;function Add-SPPermissionToListItemGroupConditional
{
 param ($Url, $ListName, $Caml, $GroupName, $PermissionLevel)
 $web = Get-SPWeb -Identity $Url
 $list = $web.Lists.TryGetList($ListName)
 if ($list -ne $null)
 {
        $spQuery = New-Object Microsoft.SharePoint.SPQuery        
        $spQuery.Query = $Caml
        $spQuery.RowLimit = 10000
        $listItems = $list.GetItems($spQuery)        
        $listItems.Count
  foreach ($item in $listItems) 
  {
   if ($item.HasUniqueRoleAssignments -eq $False)
   {
    $item.BreakRoleInheritance($True)
   }
   else
   {
    if ($web.SiteGroups[$GroupName] -ne $null)
    {
     $group = $web.SiteGroups[$GroupName]
     $roleAssignment = new-object Microsoft.SharePoint.SPRoleAssignment($group)
     $roleDefinition = $web.RoleDefinitions[$PermissionLevel];
     $roleAssignment.RoleDefinitionBindings.Add($roleDefinition);
     $item.RoleAssignments.Add($roleAssignment)
     $item.SystemUpdate();
     Write-Host &quot;Successfully added $PermissionLevel permission to $GroupName group in $ListName list. &quot; -foregroundcolor Green
    }
    else
    {
     Write-Host &quot;Group $GroupName does not exist.&quot; -foregroundcolor Red
    }
   }
  }
 }

 $web.Dispose()
}&lt;/pre&gt;&lt;pre class=&quot;csharp&quot; name=&quot;code&quot;&gt;$Url=Read-Host &quot;Enter site url&quot;

Remove-SPPermisssionFromListItemGroupSpecific $Url &quot;Shared Documents&quot; &quot;Team Visitors&quot; &quot;Read&quot;
Remove-SPPermisssionFromListItemGroupAll $Url &quot;Shared Documents&quot; &quot;Team Visitors&quot;
Add-SPPermissionToListItemGroup $Url &quot;Shared Documents&quot; &quot;Team Visitors&quot; &quot;Contribute&quot;
Add-SPPermissionToListItemGroupConditional $Url &quot;Shared Documents&quot; &quot;&amp;lt;Where&amp;gt;&amp;lt;Eq&amp;gt;&amp;lt;FieldRef Name=&#39;Create&#39; /&amp;gt;&amp;lt;Value Type=&#39;Boolean&#39;&amp;gt;1&amp;lt;/Value&amp;gt;&amp;lt;/Eq&amp;gt;&amp;lt;/Where&amp;gt;&quot; &quot;Team Visitors&quot; &quot;Contribute&quot;&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2012/02/powershell-and-sharepoint-permissions.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-8483173825097537362</guid><pubDate>Thu, 09 Feb 2012 17:10:00 +0000</pubDate><atom:updated>2013-01-26T13:38:11.614-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Report Viewer</category><title>Configure ReportViewer in SP2010</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt; &lt;br /&gt;
While I already wrote an article before on errors configuring ReportViewer in SharePoint. I get the question on steps, how to configure it without getting errors :) &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; &lt;br /&gt;
Yes additional configurations need to make it work. Web.config of the web application need to be update with following steps below.&lt;br /&gt;
&lt;ol style=&quot;margin-left: 1.5em; padding-left: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.5em;&quot;&gt; Navigate the &lt;b&gt;c:\inetpub\wwwroot\VirtualDirectories\[portno]&lt;/b&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em;&quot;&gt; Make a backup copy of web.config&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em;&quot;&gt; Open web.config in some text editor , may be notepad&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em;&quot;&gt;Look for following tag , ensure &lt;b&gt;enableSessionState=&quot;true&quot;&lt;/b&gt; &lt;br /&gt;
&amp;lt;pages asynctimeout=&quot;7&quot; &lt;b&gt;enablesessionstate=&quot;true&quot;&lt;/b&gt; enableviewstate=&quot;true&quot; enableviewstatemac=&quot;true&quot; pageparserfiltertype=&quot;Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; validaterequest=&quot;false&quot;&amp;gt; &lt;br /&gt;
&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em;&quot;&gt;Look for  &lt;b&gt;&amp;lt;httpmodules&amp;gt;&lt;/b&gt; tag and add below statement as last child node ( if not there already ) &lt;br /&gt;
&amp;lt;add name=&quot;Session&quot; type=&quot;System.Web.SessionState.SessionStateModule&quot;&amp;gt;  &lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em;&quot;&gt; Look for this tag below and update version to &lt;b&gt;10.0.0.0&lt;/b&gt; &lt;br /&gt;
&amp;lt;add name=&quot;ReportViewerWebControl&quot; verb=&quot;*&quot; path=&quot;Reserved.ReportViewerWebControl.axd&quot; type=&quot;Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, &lt;b&gt;Version=10.0.0.0&lt;/b&gt;, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;br /&gt;
&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em;&quot;&gt;Look for &amp;lt;appsettings&amp;gt; and &lt;b&gt;comment &lt;/b&gt;the entry with &lt;b&gt;name=ReportViewerMessages&lt;/b&gt;&lt;/li&gt;
&lt;/ol&gt;</description><link>http://snahta.blogspot.com/2012/02/configure-reportviewer-in-sp2010.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-981262942769504462</guid><pubDate>Wed, 18 Jan 2012 19:21:00 +0000</pubDate><atom:updated>2012-01-18T14:29:50.750-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Look and Feel</category><title>Styles not working in custom forms</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;I am sure this worked in MOSS 2007. Applying OOTB styles gives perfect look and feel for custom forms. But when I applied OOTB styles in SP2010 Visual Web part , I didn&#39;t get the right styles.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;After few comparison I realized SharePoint loads different style sheet files on different pages. So for a custom form to get the same styles as OOTB forms, there was a missing stylesheet.&lt;br /&gt;Add the following statement in your Visual Webpart to fix it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;pre name=&quot;code&quot; class=&quot;html&quot;&gt;&amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_layouts/1033/styles/Themable/forms.css&quot; /&amp;gt;&lt;/pre&gt;</description><link>http://snahta.blogspot.com/2012/01/styles-not-working-in-custom-forms.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-948216771623611945.post-8205307525008604625</guid><pubDate>Wed, 18 Jan 2012 06:40:00 +0000</pubDate><atom:updated>2012-01-18T01:48:10.659-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Error</category><title>SharePoint Error activating feature</title><description>&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;br /&gt;Got an error while activating feature.&lt;br /&gt;&lt;span style=&quot;color:red&quot;&gt;Object reference not set to an instance.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Also break point was not hitting the Feature Receiver code while debugging.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;br /&gt;Few things I tried before I found the real cause.&lt;br /&gt;&lt;br /&gt;1. Commented the code and tried, still same error&lt;br /&gt;&lt;br /&gt;2. Removed the Element manifest and tried, still same error&lt;br /&gt;&lt;br /&gt;3. Checked the feature dependency. This was the culprit. Remove feature dependency resolved the issue.</description><link>http://snahta.blogspot.com/2012/01/sharepoint-error-activating-feature.html</link><author>noreply@blogger.com (Sandeep)</author><thr:total>0</thr:total></item></channel></rss>