Gino Abraham's Blog

Sharepoint 2010

Configuration Data in a Custom Timer job in SharePoint 2010 : The Hierarchical Object Store

I was planning for a custom timer job for which i wanted to store some configuration data. Was looking for some best practices, found a useful links on The Hierarchical Object store Store http://www.chaholl.com/arch... Initially was planning for a custom list, but this would make us run a cross site query and the list name and the url should again be kept in some configuration which is an headache to maintain. Hierarchical...

A Console Application or Windows Application in VS 2010 for Sharepoint 2010 : A common Error

I have seen many Sharepoint Newbies cracking their head to create a Console/Windows application in VS2010 and make it talk to Sharepoint 2010 Server. I had the same problem when i started with Sharepoint in the begining. It is important for you to acknowledge that SharePoint 2010 is based on .NET Framework version 3.5 and not version 4.0. In VS 2010 when you create a Console/Windows application, Make Sure you select .Net Framework 3.5 in the New Project Dialog Window.If you have missed while creating...

Gettings Terms asscoiated to a Specific list item

I had a fancy requirement where i had to get all tags associated to a document set in a document library. The normal tag could webpart was not working when i add it to the document set home page, so planned a custom webpart. Was checking in net to find a straight forward way to achieve this, but was not lucky enough to get something. Since i didnt get any samples in net, i looked into Microsoft.Sharerpoint.Porta... and found a solution.The socialdataframemanager control in 14Hive/Template/layouts/Soc...

Attempted to perform an unauthorized operation – Error while updating other user’s profile data in Sharepoint 2010

We had a requirement where a user profile property will be updated from the event receiver of a custom list. The user profile property which we can had “user can override” and “Allow users to edit”, however we were getting an error “Attempted to perform an unauthorized operation” The code was running under RunWithElevated delegate. We traced the user id which was Sharepoint\System. The system account in use will be the App pool Identity under which the current Sharepoint site is running. We took...

Block Application pages and Form Pages in Sharepoint 2010

By default Sharepoint doesn’t blocks user with limited access from visiting application pages (for ex _layouts/viewlsts.aspx). Someone who knows the URL, can go to this page. We can avoid this by change the limited access to lockdown mode. Use the command below. Action Command Turn on lockdown mode for a site collection stsadm -o activatefeature -url <site collection url> -filename ViewFormPagesLockDown\featu... Turn off lockdown mode for a site collection stsadm -o deactivatefeature -url...

ULS Tracelog To WSS_Logging Database in Sharepoint 2010

By Default ULS trace logs are logged to text file in 14 Hive\LOGS. In sharepoint 2010 we have a provision to move these logs to WSS_Logging database. Follow these steps to get ULS tracelogs to WSS_Logging Database. Open the SharePoint Central Administration site Navigate to the Monitoring section Select Review Job Definitions Click on the job with the name Diagnostic Data Provider: Trace Log Click on the Enable button to enable it Click on Run Now, to start it immediately...

Add Team Site Under Publishing Site as a Subsite

By default when you try create a subsite under a Publishing site with will give you only 2 options. (Publishing Site or Enterprise Wiki). But we can enable as many site templates as we want. Go to Site Actions > Site Settings > Look And Feel > Page Layout and Site template. Select the list of templates you want

Updating Mutliselect CheckBox columns in sharepoint 2010 using SPClientCotext

In one of my project we had a scenario where we have to update a multi select choice column in sharepoint list from out client application. The asp.net way of comma seperated way was tried but didnt work for us. After lot of trial and error we found that the value should can updated as a string array. oList["MultiChoiceColeName"] = new string{"FirstVal", "ThirdVal", "lastVal"};

Lotus Notes Interop to connect from dotnet application to Lotus Notes Database

While connecting to Lotus notes database from dotnet application using Interop.Domino dll, I was getting the following error. (“Retrieving the COM class factory for component with CLSID {29131539-2EED-1069-BF5D-00... failed due to the following error: 80040154”) When i installed Domino Server setup we the issue was solved. But unforunately this will not roll out as we might have to run the migration application in different machines. After searching a lot i net i found an article in IBM site...

Powersheel script to Clear all Items in Sharepoint List

The below given powershell script will clear all items in a list. You should use powershell IDE to run this script. [System.Reflection.Assembly... Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9... $siteObj = new-object Microsoft.SharePoint.SPSite ( "http://yousiteurl" ) $SPweb = $siteObj.OpenWeb() "Web is : " + $SPweb.Title $oList = $SPweb.Lists["you list name"]; $oList.Title + " : Total Items Count is " + $oList.ItemCount $collListItems = $oList.Items;...

Full Sharepoint 2010 Archive