Sharepoint Insight by Namwar Rizvi

Sharepoint Tips, Tricks and inside knowledge from real world experience by Namwar Rizvi

Archive for August, 2008

Moving Sharepoint Portal from one server to another server

Posted by namwar on August 28, 2008

I found following article quite informative to move Sharepoint Portal from one server to another server.

It describes step-by-step procedure to move databases from one machine to another machine and how to attach them.


Posted in Configuration, Management | Tagged: , | Leave a Comment »

How to disable My Site functionality?

Posted by namwar on August 27, 2008

If you want to disable My Site or My Links functionality, here are the steps to follow:

  1. Open Central Administration site
  2. Under Shared Services Administration click your Shared Services Provider (SSP) which is running your  My Site functionality
  3. Under User Profiles and My Sites, click Personalization  Services Permissions
  4. Here you can assign different permission set for different users and groups for Personalization functionality.  For example
    1. To disable My Site functionality for all users click NT Authority\Authenticated Users group and uncheck Create personal site
    2. To disable My Links uncheck User personal features
  5. Click Save
  6. Repeat above steps to individually manage Personalization for different users and groups

Posted in Management | Tagged: , | Leave a Comment »

Sharepoint best practices: how many sites, how many libraries

Posted by namwar on August 26, 2008

While browsing Sharepoint newsgroups, I found a very useful reply from Eddy Blanco which provides excellent information to estimate your SharePoint site and structure. Following is the information, all credit goes to Eddy Blanco:

SharePoint Area of Interest Optimum Size
Site collection 50,000 per Web application
Web site 250,000 per site collection
Subsite 2,000 per Web site
Document 5 million per library
Item 2,000 per view
Document file size 50MB (2GB max*)
List 2,000 per Web site
Field type 256 per list
Column 2,000 per document library 4,096 per list
Web Part 50 per page
Users in groups 2 million per Web site
User profile 5 million per farm
Security principal 2,000 per Web site
Search indexes One per SSP, Maximum of 20 per farm
Indexed documents 50,000,000 per content index
Content sources 500 per SSP
Start Addresses 500 per content source
Alerts 1,000,000 per SSP
Scopes 200 per site
Display groups 25 per site
Crawl rules 10,000 per SSP
Keywords 15,000 per site
Crawled properties 500,000 per SSP
Managed properties 100,000 per SSP
Authoritative pages 200 per relevance level
Results removal 100
Crawl logs 50,000,000
Shared Services Provider (SSP) 3 per farm (20 per farm maximum)
Zone 5 per farm
Web application 99 per SSP
Internet Information Services (IIS) application pool 8 per Web server
Site collection 50,000 per Web application
Content database 100 per Web application
Site collection 50,000 per database
Index servers 1 per SSP*
Application servers running Excel Calculation Services No limit
Query servers No limit
Web server/database server ratio 8 Web servers per database server
Web server/domain controller ratio 3 Web servers per domain

Posted in Architecture | Tagged: | Leave a Comment »

SPDiffUtility: An excellent class to find differences in strings with HTML highlighting

Posted by namwar on August 25, 2008

While exploring Sharepoint utility classes, I found an excellent class which deserve more credit then it currently enjoys. It is SPDiffUtility. This class has only one static method called Diff which determines the text differences between two strings. It takes three parameters:

  1. str1: The original string
  2. str2: The changed string
  3. maxDifferences: A 32-bit integer representing the maximum number of differences to find.

The beauty of this function lies in its return value which is a merged version of the specified strings that contain HTML tags indicating inserted, deleted, or changed text.

This returned string contains HTML tags to highlight the changes, insertions and deletions. The best part is that you can set these tags with your HTML tags if you want. Following is the sample usage of this class.

  1. Create a web site project in Viusal Studio
  2. Add reference to Microsoft.Sharepoint.dll found in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll
  3. Paste the following code in Default.aspx
  4. <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %>
    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”&gt;
    <html xmlns=””&gt;

    <head runat=”server”>
    <title>Untitled Page</title>

    <style type=”text/css”>
    .ms-diffdeletenostrike {
    BACKGROUND-COLOR: #e0e0e0;
    .ms-diffdelete {
    BACKGROUND-COLOR: #e0e0e0;
    .ms-diffdelete {
    TEXT-DECORATION: line-through;
    .ms-diffinsert {
    BORDER-RIGHT: #ffffff 1px solid;
    BORDER-TOP: #ffffff 1px solid;
    = BORDER-LEFT: #ffffff 1px solid;
    BORDER-BOTTOM: #ffffff 1px solid;
    = BACKGROUND-COLOR: #ffeaad;

    <form id=”form1″ runat=”server”>
    <asp:Label ID=”lblResult” runat=”server” Text=””></asp:Label>



  5. Open Default.aspx.cs and paste the following code

  6. using System;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using Microsoft.SharePoint.Utilities;
    using System.Diagnostics;

    public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    string firstString = “This is an initial string”;
    string secondString = “This”;

    //Set the tags
    SPDiffUtility.ChangeOpenTag = ““;
    SPDiffUtility.ChangeCloseTag = “
    SPDiffUtility.InsertOpenTag = ““;
    SPDiffUtility.InsertCloseTag = “
    SPDiffUtility.DeleteOpenTag = ““;
    SPDiffUtility.DeleteCloseTag = “

    //end setting tags

    //Find the difference
    string diffString = SPDiffUtility.Diff(firstString, secondString, Int32.MaxValue);
    lblResult.Text = diffString;


  7. Run web application by pressing Ctrl+F5

You will see “This is an intial string where striked out letters are those which have been deleted in the second string.

Posted in Object Model | Tagged: , | 2 Comments »

How to find End Date Pattern in Sharepoint Recurring Event

Posted by namwar on August 18, 2008

Sharepoint recurring events are similar to Outlook recurring events and provides several options to specify End Date pattern. If you find the type of End Date pattern in a recurring event you can find it in AfterProperties field of SPItemEventProperties object. Just check following


Following are possible outputs and their meaning

  • 0   No end date.
  • 1   End after a specified number of occurrences. Requires that RecurrencePattern#repeatInstances:fRecurrence be specified.
  • 2   End by a specified date. Requires that RecurrencePattern#windowEnd:fRecurrence be specified.

Posted in Event Handler, Object Model | Tagged: | Leave a Comment »

Cannot start service SPAdmin on computer

Posted by namwar on August 12, 2008

It is really frustrating if you see the error “Cannot start service SPAdmin on computer” after running Sharepoint Product and Technologies Wizard when you know that there is nothing wrong from your side. After researching on internet I found an article here which describes four possible solutions. In my opinion, the fourth solution is the best and works 90% of the time. Following is the solution (All credit goes to original author):

Step 1

On the machine where psconfig failed to start the SPAdmin service run:

%commonprogramfiles%\Microsoft Shared\Web Server Extensions\12\BIN\psconfig -cmd upgrade -inplace b2b -wait -force

Step 2

Modify the service timeout values in the Registry:

HKLM\SYSTEM\CurrentControlSet\Control add/modify DWORD value ServicesPipeTimeout to 60000 (60 seconds)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control add/modify STRING value WaitToKillServiceTimeout to 120000 (120 seconds)

Step 3

Restart the server machine.

Posted in Configuration | Tagged: , | 2 Comments »

Visual Studio 2008 Extensions for WSS, Version 1.2

Posted by namwar on August 7, 2008

Visual Studio 2008 Extensions for windows Sharepoint Services 3.0 is an excellent toolkit to develop Web Parts, Custom Fields, List Definitions etc.

You can download it from here

You will need following on your PC

  1. Windows Sharepoint Services 3.0 (Only Basic Installation)
  2. Visual Studio 2008 (Standard, Professional or Team Edition)

This toolkit provides

Visual Studio 2008 Project Templates

  • Web Part
  • Team Site Definition
  • Blank Site Definition
  • List Definition
  • Empty SharePoint Project

Visual Studio 2008 Item Templates (items that can be added into an existing project)

  • Web Part
  • Custom Field
  • List Definition (with optional Event Receiver)
  • Content Type (with optional Event Receiver)
  • Module
  • List Instance
  • List Event Handler
  • Template

SharePoint Solution Generator

  • This stand-alone program generates a Site Definition project from an existing SharePoint site. The program enables developers to use the browser and Microsoft Office SharePoint Designer to customize the content of their sites before creating code by using Visual Studio.

Posted in Templates | Tagged: , , | Leave a Comment »