Thursday, December 9, 2010

High Memory and CPU Usage by fixmlindex.exe FAST 2010 for SharePoint

 

I had the FAST Search server 2010, SharePoint 2010 and SQL Server 2008 R2 installed on a single demo machine. Though this is not something which Microsoft recommends, it was very important when you visit clients for showing a demo showcasing the capacity of FAST.

When I tried to verify the memory and CPU consumption in the Task Manager, it did not took a long time to understand that the SQL Server and a FAST Search Server exe was one of the major culprits in bringing the system down on many of the occasions.

It appeared that continuously adding managed properties continuously across all the demos was leading to a continuous update in the index for the properties, which led to a high memory and CPU usage.

To overcome this, you should perform the following steps:

  1. Perform complete schema update
  2. In the FAST powershell run the command “nctrl stop”
  3. delete the file  “etc\config_data\Schema\webcluster\summaryclasses.xml”
  4. In the FAST powershell run the command “nctrl start”

This should handle most of the issues  related with high CPU and memory usage.

Tuesday, December 7, 2010

Custom Login Page for Forms based authentication

While migrating the SharePoint 2007 sites for one of the clients running on Forms based authentication, I had to break my head on making the default login page to work in the migrated SharePoint 2010 environment.
On a deep dive into the SharePoint 2007 Login Page and SharePoint 2010 Login Page  for Forms based authentication in the Fiddler, I found out that the SharePoint 2007 Login page generates a cookie ASPXAUTH which is different from the SharePoint 2010 environment which generates the FedAuth cookie.
To dig more deeper and understand things better, when I opened the default.aspx, I could see that it inherited from the FormsSignInPage rather than the LayoutsPageBase.
With all this, I decided to create a New Custom Login Page for My Requirement using Visual Studio 2010.

CUSTOM LOGIN PAGE

  • Open the Visual Studio 2010 and create an Empty SharePoint Project.
 image
  • In the Configuration Wizard, Select the option of “Deploy as FARM Solution”, because we will be using the Application Pages and deploying the solution to the SharePoint 14 hive folder. The Sandboxed Solutions cannot be deployed on the SharePoint 14 hive folder.
image
  • Once the solution is created, right click on the solution and click to add an Application page which will be used as a Login page in my application.
imagenc
  • If you plan to use any images on the login page control, the add the mapped image folder by right click on the solution and click “Add” and then select “SharePoint Mapped Images Folder”
image
  • Add a reference of the Microsoft.SharePoint.IdentityModel.dll
For adding the reference of the Microsoft.SharePoint.IdentityModel dll, navigate to the c:\Windows\Assembly\GAC_MSIL folder.
Select the folder “Microsoft. SharePoint.IdentityModel”
once the folder is opened, you will find a version and guid mapped folder,
once you open the folder, you will see the dll from which you need to add a reference to your application.

image

  • Once the reference of the dll has been added into the solution, we need to add a Reference of the Microsoft.SharePoint.IdentityModel in the aspx page as a directive.
<%@ Assembly Name="Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
  • Also Add the default Login control
<asp:Login ID="signInControl" FailureText="<%$Resources:wss,login_FailureText%>"
        runat="server" Width="100%" DisplayRememberMe="false" />

Custom Login Logic
If you want to add the Custom Login logic into your control, like, you need to perform some additional activities like sending mails to the user, generating notification alerts for the user, then you will need to place your custom logic in the code behind pages.
  • Add the directive using Microsoft.SharePoint.IdentityModel.Pages;
  • open the code behind page,Login.aspx.cs, and change the default parent class from LayoutsPageBase to FormsSignInPage.

Once all this has been performed, the development of the login page is complete and we need to configure the Login page in the central administration.

CONFIGURE THE CUSTOM LOGIN PAGE IN CENTRAL ADMINISTRATION

  • Open the central administration, click on the “Manage Web Applications”
  • select your web application and then click on the “Authentication Providers” button.
image
  • Select the zone on which you want to set this Custom login page and then go to the Sign In Page URL and set the Custom Sign In Page with the page just created.
image
  • Once all this has been performed, you will be able to see the Customized Login Page.
image

Thursday, November 4, 2010

Unknown server tag ‘asp:ListView’ error with SharePoint 2010

Problem Statement

I had created a SharePoint 2010 Web Part which was using the ASP.NET List view. The code compiled fine and was deployed properly. However, when I was trying to add the web part to the Web part page, I was getting the following error:

Unknown server tag ‘asp:ListView’

Resolution

Open the web.config and add the following entry in <Controls>

<controls>
       <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </controls>

Tuesday, November 2, 2010

Managed Meta Data Service in SharePoint 2010– I

 

Managed meta data is a hierarchical collection of centrally managed terms that you can define and then subsequently use them as attributes for various items in SharePoint 2010. The Keywords and the collections can be stored and managed independently from their actual association in the application.

The different components of Managed Meta data are

  • Groups : The group is the container which hosts one or more term sets. These term sets in turn host the Terms which can be used for characterizing the items in the List / Library.
  • Terms: A term is a keyword or a combination of keywords (Phrase) which can be associated with one or more items in SharePoint 2010.
  • Term Sets: A term Set is a collection of similar terms which can be structured in a hierarchical manner.
  • Managed Terms:
  • Managed Keywords:

There are two types of Terms available :

  • Local Terms : is a collection of terms within the context of a site collection. if for example you create a new column
  • Global Terms : are created outside the context of the site collection.

    There are two ways of adding the Terms in the “Term Store Management Tool”. Adding the terms directly by going to the “Central Administration” –> “Manage Service Application” –> “Managed Metadata Service” –> “Term Store Management Tool”.

    Hint: In the central administration, If you don’t get an option of manipulating the terms then it basically means that the user does not have proper access to the tool. you should add the user to the “Term Store Administrators”.

    you can also add the terms by importing a csv file of keywords.

    image

    The Terms added through the “Term Store Management tool” are global in nature.

    The process of including the tags in the Tasks involves the following activities:

    • Create a Column Managed Metadata in the List / Library
    • Select the Term Set that will be used to characterize the items in the List / Library.
    • Select the Tags for the individual items in the List / Library.

     

    Supported Term Types

    SharePoint provides support for two different types of terms:

    • Equivalent Terms
    • Hierarchical Terms

    Equivalent Term Types

    SharePoint provides support for synonyms or most preferred terms. For e.g., MCSD corresponds to “Microsoft Certified Software Developer”. This provides fair information about the equivalence amount of information for a specific word.

    Hierarchical Term Types

    This helps in setting the information hierarchy across the organization and helps in categorizing the data.

    For e.g., Organization –> Departments-> Sub Departments—> Functional Areas etc..

    Advantages of Managed Metadata

    The managed meta data can be used in many ways:

    • It provides a consistency in documents and information classification. Since the information is stored at a central repository and the end users are expected to select on or more of the managed keywords for each of the items, it helps in virtual classification  of documents and records across all the items.
    • Search Support and Behavior: A analysis of the keywords will help in understanding the search behavior of the users.
    • In an advanced scenarios these behavior information can be used to provide the adequate consistent information in presenting the content to the user while using the Search based architecture to present the content to the user.
    • An hierarchical view of search keywords can be used to perform the hierarchical classification of data and drill down support.
  • Friday, October 29, 2010

    SharePoint 2010 Migration: Attach Database and Upgrade Methodology

     

    You may run across scenarios where you would like to create an entirely new infrastructure for the SharePoint 2010 instances. In such scenarios, the Attach Database and Upgrade method can be applied.

    The Database upgrade method upgrades only the content of the database and does not upgrades any of the settings on the new SharePoint 2010 Server.

     

    The complete process of Database Attach and upgrade can be accomplished using the following steps:

    1) Take a backup of the Content database of the SharePoint 2007 Server. you should take the backup of the following:

      • All the Content databases of SharePoint 2007 Sites which needs to be migrated to the SharePoint 2010
      • If your SharePoint 2007 sites uses some additional database and you want these custom Databases to be migrated to the new server, then you should take a backup of these database as well.
      • Shared Services Database
      • Search Database
      • My Sites Database

    Upgrading SharePoint 2007 32 Bit to SharePoint 2010

    By default, the SharePoint 2010 is available only in 64 bit  mode. To be able to upgrade the SharePoint 2007 32 bit to SharePoint 2010, you will first need to upgrade your SharePoint 2007 32 bit to SharePoint 2007 64 bit if you are interested in migrating only some of the SharePoint sites.

    The stsadm command for taking a backup of a site

    stsadm –o backup –url <url of the SharePoint 2007 site> –filename <Path and file name of the backup file>

    you can also use –force switch to force the backup process in case of any issues.

    image

    If you want to migrate the entire Farm, you can take a backup of the entire 32 bit farm and restore it in SharePoint 2007 64 bit.

    you can use the stsadm command to backup the entire farm

    stsadm -o backup -directory <\\server name\folder name> -backupmethod full

    you can take a backup of the SharePoint 32 bit site and restore it on a 64 bit site.

    Feasibility Study of SharePoint 2007 to SharePoint 2010 migration

    if your SharePoint 2007 server does not have sp2, then you will need to update the SP2 on the SharePoint box before you evaluate the feasibility of upgrading to SharePoint 2010.

    Backup Database in SQL Server 2008

    The process of taking a backup of the database in SQL Server 2008 is as follows:

    1) Start the SQL Server Management studio

    2) Right click on the Database that needs to be backed up

    3) Select Backup

    4) Provide a valid path to save the backup.

    Restore SharePoint 2007 32 bit backup to SharePoint 2007 64 bit backup

    you can restore a SharePoint backup of a SharePoint Site using the following stsadm command

    stsadm –o restore –url <url of web application> –filename <Full path of the backup file>

    Pre Upgrade Check on SharePoint 2007 Site

    you can run the stsadm command on the SharePoint 2007 server to verify the upgrade readiness for the sites in the SharePoint Server. if the installation is a farm installation, the command should be run on the SharePoint box hosting the “Central Administration

     

    This command was first introduced with wss 3.0 sp2. This command is intended to run a set of rules that will assist the administrators to prepare the existing sharepoint 2007 installation to a future sharepoint 2010 version.

    The parameter –rulefiles takes a valid rule file and is an optional parameter. It requires a quoted, delimited (comma or semicolon) list of rule file names. By default this command is run for all the available rule files. The rule files are available in the 12 hive\config\preupgradecheck folder.

    The parameter –listrulefiles lists all rule files without executing the check routine. This is also an optional parameter.

    The parameter –localonly is a required parameter and checks the local server with the rules marked as local only and evaluates them.

    image

    It also generates a detailed html report in the logs folder

    image

    You can check the microsoft knowledgebase for corrective actions.

    http://support.microsoft.com/kb/960577

    For additional details on this you can check my blog http://sharepointtech.wordpress.com/2010/10/17/sharepoint-2010-migration-part-i/

    Add Pre Checks before attaching this backup on the new SharePoint 2010 site

    A SharePoint Site may contain one or more of the following additional components:

    • Web Parts
    • Custom Assemblies
    • Custom Site Definitions
    • Custom Features
    • Custom Master pages
    • InfoPath Forms
    • Modified Web.Config
    • Custom Workflows

    All such items needs to be manually migrated and applied on the SharePoint 2010 Website.

    These items needs to be applied before attaching the SharePoint Database.

    To understand the feasibility and custom items required for migrating, you can use the PowerShell Command Test-SpContentDatabase.

    Test-SPContentDatabase –Name <database name> -WebApplication <Web application URL> [-ServerInstance <ServerInstanceName>] [-DatabaseCredentials <Domain\username>]

    If there is any Pre requisite item that needs to be applied on the server before the database is attached then you will need to apply all such items to the candidate web application.

    Once these checks are applied then you can attach the database.

    Attaching Database in case there are multiple content database in SharePoint 2007 Site

    If the SharePoint 2007 site contains multiple databases, then the order of attaching the content database is as follows:

    1. The Content DB containing the root site collection is always applied first.
    2. The other content DBs can be applied in any order.

     

    Attach the Content DB To SharePoint 2010 Application

    The process of attaching the content DBs in the SharePoint 2010 Web Application should be done through STSADM tool. For Attaching the Content DB to a SharePoint 2010 Web application, you should perform the tasks in the following order:

    1. Restore the Content DBs to New SQL Server Instance
    2. Delete the existing content DB of the Web application
    3. Attach the Content DB of the Root Site collection
    4. Attach the Content DB of other Site / Site Collections if any
    5. perform an iisreset
    6. Open the SharePoint 2010 Web Application
    7. Perform the Visual upgrade to get the SharePoint 2010 Look and Feel

    Upgrade MySite

    To upgrade the MySite to SharePoint 2010, you should perform the following activities

    1. Configure the My sites in SharePoint 2010
    2. Perform the Content DB attachment method as discussed earlier.

    Thursday, October 28, 2010

    Indexing Very Large Files in SharePoint 2010

     The limitation of indexing Files greater than 16 MB in size still exists in SharePoint 2010. The limitation was enforced to avoid network clogging and improve SharePoint performance.

    In all such scenarios, where the file format is Compatible to SharePoint and the size of the file is larger than the max threshold size, the indexer is able to index the metadata of the file. however, the content of the file is not indexed.

    For all files which are smaller than 16 MB in size and the file format is compatible to SharePoint, the content as well as the metadata of the file is indexed.

    The major problem is that in SharePoint 2007, all such scenarios where the File Size was greater than 16 MB, were logged in as warning in the Crawl logs. However, there is no such warning generated in case of SharePoint 2010 and hence it is very difficult to understand the issue.

    This whole behavior is guided by two registry values:

    • MaxDownloadSize :  This specifies the maximum size of the document text that is filtered.
    • MaxGrowthFactor : This specified how large the output of the index filter can be.

     

    By default , the MaxDownloadSize is 16 MB and the MaxGrowthFactor is 4 MB in Size. This basically implies that:

    • The maximum size when you index file share will be 16 * 6 = 64 MB
    • The maximum size when you index document on the web site will be 16 MB.

     

    Before SharePoint 2010, this settings were modified by modifying the registry information at

    HKEY_LOCAL_MACHINE -> SOFTWARE –> Microsoft –> Office Server -> 12.0 –> Search –> Global –> Gathering Manager

    However for some reasons these settings don’t persist when applied in SharePoint 2010 environment. you need to alter the settings using the PowerShell.

    image

     

    The max value supported by “MaxDownloadSize” is 2 GB.

    Wednesday, October 27, 2010

    Execute VSeWSS Projects in Visual Studio 2010

     

    The solutions developed in VSeWSS extensions are not directly portable into Visual Studio 2010.

    To Run the VSeWSS Projects in Visual Studio 2010, an import tool has been released in MSDN which helps in executing the VseWSS Projects. This tool gets installed as a Visual Studio 2010 add in and provides a new SharePoint Project Template .

    The tool is available at the following location:

    http://code.msdn.microsoft.com/VSeWSSImport

     

    All the discussions related with this tool is available at

    http://code.msdn.microsoft.com/VSeWSSImport/Thread/List.aspx

    Thursday, October 21, 2010

    SharePoint 2010 Recycle Bin

    The recycle bin in SharePoint is synonymous to Recycle bin in windows and helps the users in recovering files which have been deleted accidentally.

    The files in the recycle bin can either be recovered or can be deleted after a pre defined period of time.

    Recycle Bin Stages

    SharePoint supports two levels of Recycle bin. The initial or First level Recycle bin comes in picture when the user deletes an item from a list. Once the item is deleted again from the First level of Recycle bin it moves to the second stage of Recycle bin.

    clip_image001

    clip_image002

    Access Restrictions on Recycle Bin

    The restoration access on the First Stage Recycle Bin is available to all the site users. However, restoration access on the second stage Recycle Bin is available only to the Site Collection Administrators.

    Number of Recycle Bin

    There is one First Stage recycle bin available per site in a site collection. However, there is only one Second Stage Recycle Bin available per Site Collection.

    Item not available in Recycle Bin

    If you try to find an item in the recycle bin and fail to locate it then you need to verify the following :

    1. The contents in the recycle bin are driven by the access control. The user who has deleted the content will be able to see the content in the recycle bin. Other users will not be able to see the items in the recycle bin.

    2. If you have deleted a top level item like a folder or a list, and try to find a document available at an inner location, then the item will not be viewable. By default the Recycle bin shows the top level content and does not have the capability to show the items in a tree structure or drill down mode.

    3. The contents in the recycle bin contains only the items within the site. A deleted site is outside the scope of the Recycle bin and is not available for deletion.

    4. The recycle bin contains the items for a pre defined period which can be set from the Web Application –> General Settings. if the thresh hold is crossed, the item is deleted permanently.

    Configure Recycle Bin

    Recycle Bin can be configured from the central administration.

    1. Click on Manage Web Applications

    2. Select the Web Application for which the recycle bin configuration needs to be configured.

    3. Click on General Settings in the Ribbon –> General Settings from the drop down as well.

    clip_image003

    Remove “Recycle Bin” Link from SharePoint Site

    1. Open the sharepoint Designer

    2. Check out the master page

    3. Open the master page in SharePoint Designer

    4. Find the </Head> tag

    5. Add the following text above the <HEAD> tag.

    <style>                                                                 

    .s4-specialNavLinkList 

    {  

        display:none !important; 

      } 

    </style> 

    6. Check in the master page