Tuesday, May 22, 2012

SharePoint 2010 Capacity Planning

This article provides an overview of how to effectively plan and manage the capacity of SharePoint 2010 environments. This article also describes how to maintain a good understanding of the capacity needs and capabilities of your deployment, by analysis of performance and volume data.

Capacity management is an ongoing process, You need to plan for growth and change, so that your SharePoint Server 2010–based environment can continue to deliver an effective business solution.
The capacity management model includes additional steps to help you validate and tune the initial architecture, and provides a feedback loop for re-planning and optimizing the production environment until it can support design goals with optimal choices of hardware, topology, and configuration.

# The following specialized terms are used in SharePoint 2010 capacity management:

RPS:   Requests per second. The number of requests received by a farm or server in one second.
Peak hours:   The time or times during the day when load on the farm is at its maximum.
Peak load :  The average maximum daily load on the farm, measured in RPS.
Load spike:   Transient load peaks that fall outside usual peak hours. These can be caused by unplanned increases in user traffic, decreased farm throughput because of administrative operations, or combinations of such factors.
Scale up:   To scale up means to add resources such as processors or memory to a server.
Scale out :  To scale out means to add more servers to a farm.
Throughput:  Throughput is defined as the number of concurrent requests that a server or server farm can process.


# Limits and boundaries:
Web application limits

Content database size ( general usage scenarios)
200 GB per content database
Content database items
60 million items including documents and list items
Site collections per content database
2,000 recommended
5,000 maximum
Web site
250,000 per site collection
Site collection size
Maximum size of the content database
Web parts
25 per wiki or Web part page

List and library limits
The following table lists the recommended guidelines for lists and libraries.
List row size8,000 bytes per row
File sizeThe default maximum file size is 50 MB and  Maximum 2 GB.
Documents30,000,000 per library
Major versions400000
Items30,000,000 per list
List view lookup threshold8 join operations per query
List view threshold5000
List view threshold for auditors and administrators20000
Subsite2,000 per site view

Column limits
SharePoint Server 2010 data is stored in SQL Server tables.

Single line of text28 bytes
Multiple Lines of Text28 bytes
Choice28 bytes
Number12 bytes
Date and Time12 bytes
Lookup4 bytes
Yes / No5 bytes
Person or group4 bytes
Hyperlink or picture56 bytes
Calculated28 bytes

Blog limits
The following table lists the recommended guidelines for blogs.

Blog posts5,000 per site
Comments1,000 per post


Groups limits 

Number of SharePoint groups a user can belong to5000
Users in a site collection2 million per site collection
Active Directory Principles/Users in a SharePoint group5,000 per SharePoint group
SharePoint groups10,000 per site collection


References:
2.       Column limits

Wednesday, April 25, 2012

Display Item Attachments in SharePoint List View

It is very easy to display list item attachments
in List View and also manipulate the display of attachment, like if attachment is
image, we can display image not just a link.
1. Open List View in SharePoint Desinger
2. Add new column titled "Attachments".
3. Select TD tag of New column.
4. Replace selected code with below code.


 <td id="ItemAttchment" class="ms-vb">
          <xsl:element name="SharePoint:AttachmentsField">
          <xsl:attribute name="runat">server</xsl:attribute>
                    <xsl:attribute name="FieldName">Attachments</xsl:attribute>
          <xsl:attribute name="ControlMode">Display</xsl:attribute>
          <xsl:attribute name="Visible">true</xsl:attribute>
          <xsl:attribute name="ItemId">
              <xsl:value-of select="@ID"/>
          </xsl:attribute>
          </xsl:element>
</td>


5. View with Attachments

Monday, March 19, 2012

Quick Notes: Retrieving Values in Event Receivers using BeforeProperties and AfterProperties

In SharePoint Portal development there are many scenarios where we need to develop event receivers.
So for accessing list item/ library item values, we need to use BeforeProperties and AfterProperties of SharePoint Event receivers. But some times they give empty or null values.
Below chart gives great understanding of which values are populated in BeforeProperties , AfterProperties and properties.ListItem objects.

For list:



List

BeforeProperties

properties.ListItem

AfterProperties

ItemAdding

Empty

Null

New Value

ItemAdded

Empty

New Value

New Value

ItemUpdating

Empty

Old Values

Updated Values

ItemUpdated

Empty

Updated Values

Updated Values

ItemDeleting

Empty

Original Values

Empty

ItemDeleted

Empty

Null

Empty

For library:


List

BeforeProperties

properties.ListItem

AfterProperties

ItemAdding

Empty

Null

Empty

ItemAdded

Empty

New Value

Empty

ItemUpdating

Old Values

Old Values

Updated Values

ItemUpdated

Old Values

Updated Values

Updated Values

ItemDeleting

Empty

Original Values

Empty

ItemDeleted

Empty

Null

Empty


The Synergy MOSS blog has explain this more clearly, please check here for more details.
Good Post on "SP 2010: How To – Event Receivers and Custom Error Pages" by Tobias Zimmergren . 
http://zimmergren.net/technical/sp-2010-how-to-event-receivers-and-custom-error-pages

Wednesday, February 29, 2012

Quick Notes: SharePoint Solution Deployment Commands - PowerShell

------------Add Snippet-------------------------
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\SharePoint.ps1"
Add-PSSnapin Microsoft.SharePoint.PowerShell
------------Add Solution-------------------------
Add-SPSolution "E:\SPSolutions\SharePoint. Finance.wsp"
Install-SPSolution –Identity SharePoint.Finance.wsp –WebApplication " http://SPServer:1000/" –GACDeployment -force
------------Update  Solution-------------------------
Update-SPSolution –Identity SharePoint.Finance.wsp –LiteralPath "E:\SPSolutions\SharePoint. Finance.wsp" –GacDeployment
------------Add Feature------------------------
Install-SPFeature Feature1 -force
Enable-SPFeature –Identity Feature1 –url "http://SPServer:1000/sites/Finance/"
------------Remove Feature------------------------
Uninstall-SPFeature Feature1
Disable-SPFeature –Identity Feature1 –url "http://spserver:1000/sites/Finance/"   

Microsoft has provided a tool to design PowerShell commands for SharePoint
Check this...
http://www.microsoft.com/resources/TechNet/en-us/Office/media/WindowsPowerShell/WindowsPowerShellCommandBuilder.html

Tuesday, December 27, 2011

Estimate content database storage - SharePoint 2010

This article describes how to plan for and configure the storage and Microsoft SQL Server database tier in a SharePoint 2010 environment.
The capacity planning information in this article provides guidelines for you to use in your planning. It is based on testing performed at Microsoft on live properties. However, your results may vary based on the equipment you use and the features and functionality that you implement for your sites.
This article assumes that you are familiar with the concepts presented in Capacity management and sizing for SharePoint Server 2010.
Estimate content database storage
The following process describes how to approximately estimate the storage required for content databases, without considering log files:
1.       Calculate the expected number of documents. This value is referred to as D in the formula.
2.       Estimate the average size of the documents that you will be storing. This value is referred to as S in the formula.
3.       Estimate the number of list items in the environment. This value is referred to as L in the formula. List items are more difficult to estimate than documents.
4.       Determine the approximate number of versions. This value is referred to as V in the formula. The value of V must be above zero.
5.       Use the following formula to estimate the size of your content databases:
Database size = ((D × V) × S) + (10 KB × (L + (V × D)))
The value of 10 KB in the formula is a constant that roughly estimates the amount of metadata required by SharePoint Server 2010. If your system requires significant use of metadata, you may want to increase this constant.
As an example, if you were to use the formula to estimate the amount of storage space required for the data files for a content database in a collaboration environment with the following characteristics, you would need approximately 105 GB.


Input
Value
Number of documents (D)
200,000
Calculated by assuming 10,000 users times 20 documents
Average size of documents (S)
250 KB
List items (L)
600,000
Number of non-current versions (V)
2
Assuming that the maximum versions allowed is 10


Database size = (((200,000 x 2)) × 250) + ((10 KB × (600,000 + (200,000 x 2))) = 110,000,000 KB or 105 GB

Download the Excel sheet for easy calculations.

Saturday, November 26, 2011

Check Current User Gorup In SharePoint Object Model


To manage permission we create Groups in SharePoint. In Custom SharePoint application or webpart, we have to check user permissions or may have activate different  functionality.

For that We need to check Current User Group..

Here is a function that will return true/false by providing Group Name!

private bool IsCurrentUserMemberOfGroup(string GroupName)
        {
            try
            {
              return SPContext.Current.Web.IsCurrentUserMemberOfGroup(SPContext.Current.Web.Groups[GroupName].ID);               
            }
            catch (Exception)
            {
                return false;
            }
        }


You may provide web object for performance tuning.

Friday, November 4, 2011

Remove Lookup Hyperlink from SharePoint List view using JQuery

When you use lookup to the list automatically SharePoint give link to the lookup item on list view.
Check it out….
Lookup column with Hyperlinks
But many times, we don’t want  those Hyperlinks on the list view, as we can remove it from SharePoint Designer but it’s a hectic task.
Simply add JQuery  to remove those Hyperlinks.
First, get the URL of the link using Developer tool of IE or Firebug of Firefox browser. we are going to some part of URL in the below code.

Get URL using Developer tool of IE


Then copy following JQuery code to the HTML form WebPart on list view.

Jquery For MOSS 2007/WSS 3.0:


    
    

Note: Change highlighted text as per your context.
Jquery For SharePoint 2010/SharePoint Foundation 2010:





Note: Change highlighted text as per your context.

If View is Grouped, set list view setting "By default, show groupings:" to  Expanded


List View setting: Make sure that By default, show groupings: Expanded

List view with removed hyperlinks to Lookup columns:

Live simple!