Thursday, April 30, 2009

Personalization in MOSS 2007 and Configuring Personalization

Personalization means providing a user centered experience of the Portal. Keeping user settings and preferences same every time the user logs in.

There are three main features in MOSS 2007 (SharePoint) personalization
1. User profiles
User profiles allow you to search and connect with people within your organization based on information published about them. MOSS 2007 provides a new search scope for searching people. Index Server crawls the user profile store to get the user’s information.

2. Audiences
MOSS 2007 allows you to target content to people according to their membership in a particular audience. It supports targeting to rules-based audiences, distribution lists, and Windows SharePoint Services groups. Except for Windows SharePoint Services groups, these audiences can span one or more portal sites in a deployment.
Using targeting, you can target content in the portal site for viewing by one or more specific audiences. By default, you can display targeted content on the home page and on personalization sites.

3. My Site
My Site is a collection of Profile pages, personal sites, and personalization sites created in the Office SharePoint Server 2007 site. The Profile page of the My Site displays your user profile information. Your personal site provides personalized and customized information. Office SharePoint Server 2007 also supports personalization sites. Personalization sites display targeted content to users based on their membership in a particular audience or by slicing data.

How to Create Personalized views in MOSS 2007
SSP(Shared Service provider) is necessary for creating personalized views in SharePoint

i. Audience Targeting

Importing user profiles in SharePoint from Active directory Through master connection

  • Open SSP
  • Under User Profiles and My Sites click on the link labeled “User profiles and properties”
  • On the User Profiles and Properties page click on “Configure profile import”
  • Provide a default access account, specify an account that has read access to your directory. Note: This account needs to also have Manage User Profiles rights, verify click on “Personalization services permissions” under User Profiles and My Sites on the SSP Admin page. To keep things simple until you have a grasp of the service you should use the SharePoint Admin account.

  • Click OK On the User Profiles and Properties page click on “Start full import”
  • Verify that import started and wait until import has completed before moving on to other personalization admin tasks (this may take a few hours)
  • After import is complete to view the results click on “View user profiles” on the User Profiles and Properties page
User Profiles can also be imported from SQL server or other sources using Business Data Catalog (BDC). TO learn more about configuring user profiles, Click here

Creating Audiences from User profiles
Once profile import is complete we can go back to setting up personalization services in the SSP

  • Go to the Shared Services Administration page for your SSP.
  • Click on “Audiences” under the section Audiences
  • On the Manage Audiences page click on “Create audience” Note: Audiences should not be created until after you’ve completed a profile import.
  • create a new audiences rules based on user profile data such as department, role etc.
  • once done creating audiences click on “Start compilation” from the Manage Audiences page.
  • After compilation is complete to view the results click on “View audiences” from the Manage Audiences page.

To display targeted content on SharePoint sites using web parts

  • Go to the site home page and add the Content Query Web Part. Content by query web part supports audience filtering by default.
  • Modify the Content Query Web Part Under Query
  • change List Type to Document Library
  • Under Query -> Audience Targeting check “Apply audience filtering”
  • Click OK Verify the items you targeted in the document library only show for people in those audiences.

ii. My Sites

To create a My Site

  • Click on My Site in the global actions bar which is in the top right corner of every SharePoint page.Wait while your My Site is created
  • After creation is complete check to make sure the name of the site created is titled with your name
  • If not then open a new browser window with your credentials and click the My Site link again or copy the URL behind the My Site link into the browser window.Note: My Site is highly personalized so it works best when its created using your credentials and not those of an admin account or alternate account
  • Follow the links in the Getting Started with My Site web part

iii. People Search

To configure People search in MOSS

  • Go to Shared Services Administration for your SSP Under Search section click on “Search settings”
  • On Configure Search Settings page find the default content access account
  • If this is not set then provide a default content access account Verify default content access account has Use personal features rights.
  • On Configure Search Settings page click on “Content sources and crawl schedules”
  • On the Manage Content Sources page hover over “Local Office SharePoint Server sites” and click the arrow to drop the ECB menu
  • In the drop menu click Start Full Crawl Verify that crawl started and wait until crawl has completed before moving on to search for people.
  • Once crawl is complete to main portal site and click on Search in the top navigation area to go to the Search Center
  • In Search Center click on tab labeled “People”
  • Type in a term you added to your profile while exploring your My Site such as a project, skill or responsibility Hit Enter or click the
  • Go button Verify that you and others who match that search term was returned as search results

Tuesday, April 28, 2009

MOSS Introduction for beginners

Microsoft Office SharePoint Server (MOSS) 2007 helps stream-line collaboration, shared business processes, content management, enterprise search, and data sharing. Whether you are working across departments, companies, or great distances, SharePoint Server 2007 lets you share information and work with others with great ease and complete security.

Custom Development needs for MOSS projects

  • .Net framework 3.0/3.5 depends on the user Requirement
  • Windows Server 2003
  • Microsoft Office SharePoint Server
  • Microsoft SQL Server 2005 - used internally by MOSS
  • SharePoint designer

Key Features/Elements of MOSS

  • Enterprise Search
  • Business Intelligence by providing integration with Excel Services, SSRS, PPS etc
  • Enterprise Content Management (ECM)
  • Integration with MS office
  • Security at Site Collection level to list item level
  • Site templates available to create sites and Portals easily
  • Out of the box web parts available having custom functionality by simple configuration
  • Out of the box workflows like approval workflow for implementing custom functionality
  • Integration with Reporting tools like SSRS, BSM, PPS etc
  • Every features is scoped at a Farm, Web application, Site Collection and Web Level
  • Document Management, Policy Management and Auditing
  • Personalization and deployment
  • OOB event handlers at site, web and Item level for custom functionality
  • Site Manager, which replaces the Portal Site Map administration page, is a Web-based drag-and-drop tool for managing a SharePoint site’s navigation, security access, and general look and feel.
  • Office SharePoint Server 2007 includes an LDAP pluggable provider for authenticating users of Office SharePoint Server 2007. This is in addition to the Active Directory provider included with Windows SharePoint Services.
  • Audience Targeting
  • Document collaboration
  • Wikis and Blogs
  • Really Simple Syndication (RSS) support
  • E-mail integration

Thursday, April 16, 2009

MOSS (SharePoint) online Free Test - Part two

Take a sample exam in MOSS for free in just few minutes. If you have not taken the first part of test. Please click here

1. User profiles in sharepoint is created using
Active Directory through master connection
SQL Server through Business data Catalog
None of the above

2. How many master pages can we have for a MOSS site?
any number

3. A workflow in Sharepoint is always attached to exactly one List or Library?

4. ItemUpdating is a valid synchronous list item event in Sharepoint list

5. Which is/are the elements of Excel Services in MOSS?
Excel Web Access
Excel Web Services
Excel Calculation Services
None of the above

6. which of the following interface is not supported for connectable web parts in sharePoint?

7. Using Sharepoint designer 2007, we can create custom workflow with out any code

8. SPExport class in sharepoint is/are used to Export the following and can be imported to another server
web sites
Cannot be Exported

9. Reusable content is Sharepoint is/are
Items in this list contain HTML or text content which can be inserted into web pages
If an item has automatic update selected, the content will be inserted into web pages as a read-only reference, and the content will update if the item is changed.
The reusable content is inserted into the sharepoint site pages by publishing HTML content control
All the above

10. Search in Windows SharePoint Services supports the following search syntax for building search queries
Keyword Query syntax
SQL syntax
URL syntax as query string
1, 2 and 3
1 and 3

Part one Test

1. C (both)
2. d (Any number)
3. a (True)
4. a (True)
5. a, b, c (Excel Web Access, Excel Web Services Excel, Calculation Services)
6. c (IValueProvider)
7. a (True)
8. a,b,c (Pages, Web sites, site collection)
9. d (All the above)
10. 1,2, 3(All the above)

Wednesday, April 15, 2009

Reusable Content in SharePoint

Items in this list contain HTML or text content which can be inserted into web pages.
  • If an item has automatic update selected, the content will be inserted into web pages as a read-only reference, and the content will update if the item is changed.

  • If the item does not have automatic update selected, the content will be inserted as a copy in the web page, and the content will not update if the item is changed.

The Reusable Content is created using Reusable content list available in the List all site contents under site Actions Menu. This Reusable content list has all the reusable contents for the site collection.

The first thing to understand is that Reusable Content is unique to the Publishing feature in MOSS. It can only be leveraged in Publishing sites and pages because it is available in only in the Page Content Field, one of the out-of-the-box columns available in Article Page and Welcome Page page layout content types.


The reusable content is inserted into the sharepoint site pages by Rich text editor or publishing HTML content control for a Page Content Field which has icon to insert the Reusable content.

The step by step configuration for reusable content in MOSS is available here

Friday, April 10, 2009

Creating Custom Web part in MOSS and add custom properties to the Tool part

You can create a Custom web part for implementing the custom functionalites in SharePoint by deriving the class from Microsoft.SharePoint.WebPartPages.webPart Class.

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebPartPages;

public class CustomWebPart : WebPart
protected override void CreateChildControls()
// to do : Create the child controls of the web part and add to the controls collection
Button btncntrol = new Button();
public override void RenderControl(HtmlTextWriter writer)
// render control here

CreateChildControls and RenderControl methods are used to add controls to the web part also apply styles to the web part.

To add custom properties to the Tool Part in Modified Shared Web Part

[Browsable(true), Category("Behavior"), DefaultValue(false),
FriendlyName("Enable values "),
Description("To modify values")]
public bool ShowCustomProperty
return showCustomproperty;
showCustomproperty = value;

To have more customization in the tool part like “on click of image a dialog should open”. Override GetToolPart method in web part class.

When the end-user chooses to modify a Web Part, the framework will call the GetToolParts method of the Web Part class. By overriding this method, I can control the order and appearance of the Tool Parts.

public override Microsoft.SharePoint.WebPartPages.ToolPart[] GetToolParts()
// returns array of tool part. Custom propery is also added here...

To learn more about creation of web part and connectable web parts in MOSS Click Here

Export and Import APIs in MOSS for migrating content

To Export Pages / Images/ Webs/Pages from one site or web site or sub site to another SharePoint site using content Migration APIs. This took physical copy of each object (pages, web sites, sub sites, site collection) and it can be moved to any other server.

The Content Migration APIs in Windows SharePoint Services 3.0 provide a flexible set of tools for migrating content between Windows SharePoint Services Web sites. Windows SharePoint Services uses the concept of the content migration package, which can include either single or multiple XML files, and then provides a flexible set of APIs to enable exporting and importing the migration packages. The content import/export feature of the deployment object model allows you to export not only Web site content but also existing dependencies, like security features, user roles, versioning data, workflows, and other metadata.

SPExportSettings settings = new SPExportSettings();
settings.SiteUrl = "http://localhost:2000";
// This is used to specify whether to export all or only incremental changes
settings.ExportMethod = SPExportMethodType.ExportAll;
// Location where the physical files on export are getting stored.
settings.FileLocation = @"c:\export";
settings.FileCompression = false;
settings.CommandLineVerbose = true;

// Settings is assigned to the SPExport object
SPExport export = new SPExport(settings);
// This method exports the content and store as physical files

Similarly, import should also be done in the similar fashion with SPImport class.
These APIs are used to migrate the content(Pages / Images/ Webs/Pages ) with in the same sharepoint server as well as other servers.

SiteUrl - this property defines which site collection the export should use. All objects being exported always have to be in the same site collection. The Content Deployment and Migration API cannot access items in different site collections in a single operation.

ExportMethod - this property allows to define whether to perform an incremental export (value = ExportChanges) or everything (value = ExportAll). Be aware that ExportChanges would require to provide an Export Change Token in a separate property.

FileLocation - this property defines where to store the exported content. The value should point to be an empty directory. If the directory does not exist it will be created during export. If file compression is being used, then only the compressed files will be stored on this location. The uncompressed files will be stored in the directory identified by the value of the system wide TMP environment variable. So you need to ensure that the directory the TMP environment variable points to also needs to have sufficient space available.

FileCompression - this property defines whether the content should be compressed into a CAB file. If you need to archive the exported content or need to transfer it to a different machine you should choose to compress. If you only export the content to import it afterwards using code on the same machine and don't need to archive (e.g. a copy or move operation) then you should decide to disable the compression as this is significantly quicker.

CommandVerbose - this parameter allows to control if the API should provide some verbose output. If you have ever seen the generated output when running STSADM -o export: this is exactly the flag the generates this output. If the value is false no output is generated.

ExcludeDependencies - This property controls whether to export dependent objects like referenced images, master pages or page layouts. If it is unclear if the dependent objects are already in the destination database you should export the dependent objects as well to prevent problems.

IncludeDescendants - This property controls whether to export child objects of the selected objects (like sub webs, lists, list items) or only the selected object. Possible values are None (only the object is exported), Content (List and libraries of a web will be exported but not sub webs) and All (all child content is exported)

Thursday, April 9, 2009

Configuring incoming/outgoing email for SharePoint/MOSS 2007

SharePoint 2007 allows for emails to be accepted into discussions, document libraries and lists. To enable this functionality, a few steps will need to be followed. One thing to note: integrating SharePoint with Exchange is NOT needed for this functionality, but if you do choose Exchange, you will get some added benefits.

-SMTP Service
You will need to install the SMTP Server Service on the SharePoint server. This is done via add/remove programs, and within the IIS component listing.

-Enable Incoming Email
Now, enable Incoming Email from the Central Administration website. It is found by following: Central Administration > Operations > Incoming Email Settings

-SMTP Connector
You will finally need to configure an SMTP connector within your email server so it knows where to send emails you designate for SharePoint.

Pre Requisites
· SMTP service to be installed

Enabling incoming/outgoing email for SharePoint/MOSS 2007 is done thru SharePoint Central Administration under Operations Section.

How-to configure incoming or outgoing e-mail in sharepoint video is available here

Pre-requisites are available here

Introduction to Excel Services in SharePoint and Components

Components of Excel Services in MOSS
Excel Services is a Microsoft Office SharePoint technology that makes it simple to use, share, secure, and manage Microsoft Office Excel 2007 workbooks as interactive reports in a consistent way throughout the enterprise.

We can also create custom connectable web parts to Excel OOB web parts for having custom functionality.

1. Excel Web Access
This allows the to display excel sheets on the web page. The Excel can be shown in sharePoint page as a web part.

2. Excel Web Services
Use SharePoint Excel API to manipulate excel sheet data. But these APIs are not used create an excel sheet dynamically.

3. Excel Calculation Services
Allows you to load excel sheets on the web page (as HTML) and render calculated data fro the User defined functions.

Limitations of Excel Services
  • Will not load excel files with VBA Low fidelity.
  • Charts in excel will have low fidelity.
  • Users cannot add or rearrange fields in pivot reports using web access.
  • No authoring support

To learn more about configuring excel services in Sharepoint Click here

Wednesday, April 8, 2009

Customize sharepoint CoreResultsWebPart to apply Audience filtering

The below code is to customize the CoreResultsWebPart (Sharepoint OOB web part) to filter based on audience using Reflection. To do so, we need to derive the web part from CoreResultsWebPart class and override the SetPropertiesOnHiddenObject method.

CoreResultsWebPart class internally uses the hiddenobject class to set all the inputs to generate the Search result result. On overriding the method, we can change the input query.

To learn more about sharepoint search queries and Mananaged property Click here

For Example. to filter based on a key word "Sharepoint", MOSS generates a SQL query like this
SELECT WorkId,Path,Title,Write,Author,HitHighlightedSummary, HitHighlightedProperties,CollapsingStatus FROM Scope() WHERE FREETEXT(defaultproperties, 'SharePoint') ORDER BY Rank Desc

To apply audience, query will become
SELECT WorkId,Path,Title,Write,Author,HitHighlightedSummary, HitHighlightedProperties,CollapsingStatusFROM Scope()WHERE FREETEXT(defaultproperties, 'SharePoint') AND CONTAINS(Audience,'TestAud' ) ORDER BY Rank Desc

Audience property added in the where clause of the query is a managed property which is created using Crawled property. Once added the Audience filter in SQL query, the Search result output is automatically generated based on Audience and key word.

Sample code for audience filtering in MOSS Search Result

using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Microsoft.Office.Server.Search.Query;
using Microsoft.Office.Server.Search.WebControls;
using Microsoft.SharePoint.Administration;
using Microsoft.Office.Server;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Search;
using System.Reflection;

namespace customCoreResultsWebPart
public class customCoreResultsWebPart : Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart
protected override void SetPropertiesOnHiddenObject()
Type coreResultsWebPartType = this.GetType();

// get the private field containing the searchResultsHiddenObject srho
FieldInfo searchResultsHiddenObjectField = coreResultsWebPartType.BaseType.GetField("srho", BindingFlags.NonPublic BindingFlags.Instance);

// make sure the field exists
if (searchResultsHiddenObjectField != null)
// get the actual internal srho object attached to CoreResultsWebPart
object searchResultsHiddenObject = searchResultsHiddenObjectField.GetValue(this);

// get the type of the srho
Type searchResultsHiddenObjecType = searchResultsHiddenObject.GetType();

// get the keyword query property
PropertyInfo keywordQueryProperty = searchResultsHiddenObjecType.GetProperty("KeywordQuery", BindingFlags.Instance BindingFlags.Public);

// read what the user searched for
string keywordQuery = (string)keywordQueryProperty.GetValue(searchResultsHiddenObject, null);

// use this method to get the keywords as a query string to append to the search
// this doesn't seem to be working yet

MethodInfo keywordQueryMethod = searchResultsHiddenObjecType.GetMethod("GetKeywordsAsQuery", BindingFlags.Instance BindingFlags.NonPublic);
string keywordsAsQuery = (string)keywordQueryMethod.Invoke(searchResultsHiddenObject, null);

// set the keywordProperty to null so we can change it to a fullTextQuery
keywordQueryProperty.SetValue(searchResultsHiddenObject, null, null);

// create a new query and set it
string fullTextQueryString = null;

// get the fullTextQuery field i.e. ADVANCED SEARCH
PropertyInfo fullTextQueryProperty = searchResultsHiddenObjecType.GetProperty("FullTextQuery", BindingFlags.Instance BindingFlags.Public);

// This scenario is called when User used AADVANCED SEARCH
if (fullTextQueryProperty.GetValue(searchResultsHiddenObject, null) != null)
// This is in the form of SQL Query
fullTextQueryString = fullTextQueryProperty.GetValue(searchResultsHiddenObject, null).ToString();
// For normal Search Scenario, The keyword query is translated into SQL Query
else if (!string.IsNullOrEmpty(keywordQuery))
// This scenario, the value is just the Keyword... so modify to a SQL Query
fullTextQueryString = "SELECT WorkId,Path,Title,Write,Author,HitHighlightedSummary, HitHighlightedProperties,CollapsingStatus FROM Scope()WHERE FREETEXT(defaultproperties, '" + keywordQuery + "')";
// Not a Valid Search and hence Return
fullTextQueryString = fullTextQueryString + " AND CONTAINS (AUDIENCE,'TestAud')";

fullTextQueryProperty.SetValue(searchResultsHiddenObject, fullTextQueryString, null);

// this field needs to be set to true to use a full text query
FieldInfo fullTextQuerySetField = searchResultsHiddenObjecType.GetField("_IsFullTextQuerySetFromForm", BindingFlags.NonPublic BindingFlags.Instance);
fullTextQuerySetField.SetValue(searchResultsHiddenObject, true);

// tell the srho that it is not a keyword query any more
FieldInfo isKeywordQueryField = searchResultsHiddenObjecType.GetField("m_bIsKeywordQuery", BindingFlags.NonPublic BindingFlags.Instance);
isKeywordQueryField.SetValue(searchResultsHiddenObject, false);
catch (Exception exp)
// To do: Exception Handling

Tuesday, April 7, 2009

Maximum number of web sites and Sub sites in MOSS (SharePoint) site collection

The total number of web sites and sub sites together in one site collection should be 2, 50,000. Web sites which are actually the first sub sites under a site collection, and sub sites are the sites under the web sites.
So if you've got fewer web sites, you can have more sub sites. But for better performance use not more than 2000 sub sites per web site.

MOSS 2007 Performance guidelines for number of sites
Click here

Guidelines for acceptable performance for number of sites
Click here

Monday, April 6, 2009

MOSS (SharePoint) Frequently asked questions - MOSS online Free Test - Part one

Take a sample basic exam in MOSS 2007 for free in just few minutes

1. Can we have multiple sub sites and web sites under a site collection?

2. Which of the following are true in MOSS?
The Sites under site collection are called Web sites
The Sites under web sites in MOSS are called sub sites
Both are true
Both are false

3. Can we customize the webpart to support personalization?

4. Shared Service provider(SSP) in MOSS is provided by
Windows SharePoint Services (WSS)
SharePoint server 2007
.net 3.5

5. MOSS supports events at
Site Level
List Level
List Item Level
MOSS doesn't support events

6. In MOSS, Security can be applied at
Site Level
Sub Site or Web site Level
List /document library Level
List Item Level
All the above

7. which of the following is not a valid site group with Windows SharePoint Services(WSS)?
Web Designer

8. which of the following is/are true?
Content Type is a collection of logically related data element types or site columns
Site Column defines a data element for a site collection
Multiple content types can be added to sharepoint lists
Sharepoint doesn't have Out-Of-box workflows

9. which not a Out of the Box Workflow in MOSS?
Approval Workflow
Collect Signature Workflow
Service Workflow
Three State Workflow

10. MOSS (Sharepoint) offers
A framework that allows to build business sites rapidly
Lots of features, Workflows and site templates already built-in
Excellent integration with Word, Excel, PowerPoint etc
All the above

Go to Online Test - Part two

To learn more about frequently asked interview questions in MOSS, click here

1. a
2. c
3. a
4. b
5. a,b,c
6. e (All the Above)
7. d (Manager)
8. a,b,c
9. c
10. d (All the above)

Friday, April 3, 2009

A splash page in MOSS

A splash page can be a useful method of providing users with information on the first visit to a web site. When the main page of the SharePoint site is navigated to by a user for the first time a different page is presented. This could provide a welcome note or current information – anything that should be seen once by a user, and then not again.

the creation and configuring splash page is available here