Tuesday, November 15, 2011

Understand database mirroring requirements for disaster recovery purpose

SharePoint 2010 is mirroring aware and utilizes the FailoverPartner keyword in its database connection strings to identify a SQL Server instance that is used for mirroring purposes.  Upon learning this, it might be tempting to jump right in and start mirroring SharePoint databases for redundancy.  Before doing so, though, you should be aware that the following requirements apply:
  • Less than 1ms latency between principal and mirror SQL Server instances
  • 1GB/s bandwidth or greater between principal and mirror SQL Server instances
  • Principal and mirror instances must be running the same version and edition of SQL Server
  • Mirrored databases must use the Full recovery model
  • High safety with automatic failover (that is, synchronous mirroring with witness server) is recommended
Mirroring is certainly useful, but as the aforementioned list demonstrates: it shouldn’t be implemented without careful planning and infrastructure design.

Friday, November 11, 2011

KPI Values in SharePoint

Previous versions of SharePoint had limitations to folders support for the KPI Lists. Whenever you tried to set Folder as a source of your KPI, SharePoint gave you an error that the folder can't be selected. To avoid such situation you had to maintain KPI values in different list or use Views. The issue with Views is that they don't allow you to assign the permissions per View, so you can't have groups of data and assign different permission for KPI values based on views. The only solution for SharePoint 2007 was usage of separate Lists. SharePoint 2010 fixed this issue, and now you can organize your values per folders in one List for KPI’s.

Saturday, November 5, 2011

SharePoint BLOB Caching to increase performance

BLOB caching, or disk-based caching, is an out of the box (OOTB) caching mechanism that is built into the MOSS 2007 and SharePoint Server 2010 platforms. It is commonly used to speed-up access to large and relatively static resources that are stored in content databases, such as images, videos, javascript files, and more. Performance improvements are gained by storing these assets on web front-ends (WFEs) once they’ve been requested by a client. This allows SharePoint to serve subsequent requests for such assets directly from WFEs instead of round-tripping to the content database each time a request for such an asset is received. For most SharePoint sites, this type of caching can significantly lighten the load on your SQL Servers and back-end network.

BLOB Caching is controlled through the web.config file for each of the IIS web sites that is associated with a Web application, and it is not enabled by default. Enabling BLOB caching is as simple as setting the enabled attribute to true in the web.config element as shown below.

  BlobCache location=C:\blobCache” path=”\.(gif|jpg|png|css|js)$” maxSize=”10” enabled=true/>

Sunday, October 23, 2011

Find info about Farm Configurations

You can use the Get-SPFarmConfig cmdlet to retrieve global settings for the local farm. The cmdlet returns information for items that are not on the SPFarm Object.
PS > Get-SPFarmConfig
WorkflowBatchSize                                        : 100
WorkflowPostponeThreshold                     : 15
WorkflowEventDeliveryTimeout              : 5
DataFormWebPartAutoRefreshEnabled : True
ASPScriptOptimizationEnabled               : True

Tuesday, October 11, 2011

You Cannot Use SharePoint Foundation 2010 Objects with .NET 4

The SharePoint Foundation 2010 object model is not accessible using the .NET Framework 4 (or later).  Calling any object or method in the object model using any framework version other than .NET 3.5 will throw the following exception: 

System.PlatformNotSupportedException
Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime.


Of course, you can always access the SharePoint objects using the web services interface from your .NET 4 application, but this will only allow limited functionality of the complete object model.

Embedding a YouTube Video

To embed YouTube videos on your SharePoint site, get the ‘embed video code’ from the YouTube site and copy paste into a notepad.  Upload the notepad to a library. 
Add a content editor web part and point the content link to this notepad.  This will embed the video on the SharePoint page and can be played via the SharePoint media player.

Saturday, October 8, 2011

Using "Send To" to Route Documents

Documents are not always created in the location where they should finally be routed to.  For example, documents may be created in one site but routed to a different site for final review by clients or customers. 

This can be easily achieved in SharePoint 2010 via simple short cut menus that can be set up for a document library. This is done by enabling the content organizer features and configuring ‘send to’ connections from central administration.  This connection will then appear for all documents in a document library for the configured site.  Easily write content organization rules for the drop library to route the document to its final destination.

Thursday, October 6, 2011

Sync Users Information from Active Directory

You can sync User information from the User Directory Store. Simply, use the Set-SPUser cmdlet and use the SyncFromAD switch parameter to enable syncing. 
PS > Set-SPUser -Identity powershell\username
>> -Web http://sp01 -SyncFromAD

Monday, October 3, 2011

Adding Text Fields to a List

You can use Windows PowerShell to add Text fields to a List in SharePoint 2010. Simply use the Add() method available on a fieldcollection. The example below demonstrates how to add a Text field to the Tasks list, set a Description and set the field as required. Note that the Add() method allows us to specify the Fields Name, the Type of Field and a Boolean value that determines if the field should be required.

PS > $spWeb = Get-SPWeb http://SP01.powershell.nu

PS > $spList = $spWeb.Lists["Tasks"]
PS > $spList.Fields.Add("Text Field","Text",$true)
PS > $spList.Fields[“Text Field”].Description =My Custom Text Field
PS > $spList.Fields[“Text Field”].Update()
PS > $spWeb.Dispose()

Friday, September 30, 2011

Install PDF Filter Using PowerShell

SharePoint 2010 doesn’t support PDF files by default. You can solve this by installing Adobe PDF iFilter 9 for 64-bit platforms and following the steps described below. First, you can download PDFFilter64installer.msi: http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025
You’ll also need an icon that will be used in SharePoint 2010 for PDF files:
http://www.mossgurus.com/adnan/Documents/pdf16.gif

Next, start PowerShell and run the following command to install the MSI Package and configure SharePoint 2010:

# Install MSI
PS > $iFilter =C:\Media\IFilter\PDFFilter64installer.msi”
PS > Start-Process -FilePath $IFIlter -ArgumentList "/quiet"Wait
# Copy Icon to SharePoint Folder
PS > $icon =C:\Media\IFilter\pdf16.gif”
PS > Copy-Item -Path $Icon -Destination "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES"
# Modify DocIcon.xml
PS > $path = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML\DOCICON.XML"
PS > $xml = New-Object XML
PS > $xml.Load($path)
PS > $element = $xml.CreateElement("Mapping")
PS > $element.SetAttribute("Key","pdf")
PS > $element.SetAttribute("Value","pdf16.gif")
PS > $xml.DocIcons.ByExtension.AppendChild($element) | Out-Null
PS > $xml.Save($path)
# Add PDF type to Search Service Application
PS > New-SPEnterpriseSearchCrawlExtension -Name "pdf" `
>> -SearchApplication SearchServiceApp
# Modify Registry
PS > mkdir 'HKLM:\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf'
PS > Get-Item 'HKLM:\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf' | >> Set-ItemProperty -Name "(default)" `
>> -Value "{E8978DA6-047F-4E3D-9C78-CDBE46041603}"
# Restart Search Service
Get-Service | Where-Object { $_.Name -eq "OSearch14" } |
>> Restart-Service

Tuesday, September 27, 2011

KPI Values in SharePoint 2010

Previous versions of SharePoint had limitations to folders support for the KPI Lists. Whenever you tried to set Folder as a source of your KPI, SharePoint gave you an error that the folder can't be selected. To avoid such situation you had to maintain KPI values in different list or use Views.
The issue with Views is that they don't allow you to assign the permissions per View, so you can't have groups of data and assign different permission for KPI values based on views.
The only solution for SharePoint 2007 was usage of separate Lists. SharePoint 2010 fixed this issue, and now you can organize your values per folders in one List for KPI’s.

Sunday, September 25, 2011

PowerShell commands for SharePoint 2010

PowerShell commands for SharePoint 2010 To find the PowerShell commands n SharePoint 2010, try these:
>Get-Command -Noun SPSite
You can get the all PowerShell commands:
>Get-Help Get-SPSite
You can get the Name, Syntax, Description, Related Links, Remarks
To Retrieve content database for a specific site collection:
>Get-SPContentDatabase -Site http://SPServer01
Results:
ID:96dfa345-43df-3edg-bbc6-1l4e8ee105le
Name:WSS_content
Web Application:SPWeb Application Name=Sharepoint - 80
Server:SPServer01
CurrentSiteCount
:2

To retrieve the content database for a specific Web Application:
>Get-SPContentDatabase -WebApplication "Sharepoint - 80"
Results:
ID:96dfa345-43df-3edg-bbc6-1l4e8ee105le
Name:WSS_content
Web Application:SPWeb Application Name=Sharepoint - 80
Server:SPServer01
CurrentSiteCount
:2
I hope this tip helps someone else save time and frustration as it did for me.

Monday, August 15, 2011

Plan for SQL snapshots with SharePoint 2010

One of the nice new features that SharePoint 2010 brings to the table is the ability to integrate with SQL Server’s snapshot generation and management functionality.
Using SQL Server snapshots makes it possible for administrators to conduct some previously disruptive operations with minimal user impact.
For example, site collection backups normally require that a site collection be write-locked in order to maintain consistency during the backup process.
The same backup can be taken against a SQL Server snapshot without incurring the adverse effects of a write lock, permitting users to continue working with the site collection being backed-up without being forced into read-only mode.

There’s a catch, though: SQL Server snapshot capabilities only exist in the Developer and Enterprise editions of SQL Server.  If you would like to use SQL Server snapshots with SharePoint 2010, be sure to plan on the use (and licensing) of SQL Server Enterprise in your farm.

Monday, August 8, 2011

SharePoint and SQL Server replication

For several versions now, SQL Server has included the ability to replicate content between databases. In the quest to make SharePoint highly available, you might be tempted to investigate SQL replication of SharePoint databases using this mechanism.
Unfortunately, SQL Server replication is not supported with SharePoint. If you are seeking to make your SharePoint environment highly available, look instead to other technologies such as Windows clustering and SQL Server database mirroring.
SQL Server transaction log shipping may also fit the bill for you if your requirements are more tolerant to data loss and down time.
Alternatively, there are third party products which can perform replication in SharePoint-friendly fashion.

Wednesday, August 3, 2011

Keep an eye on your content database sizes

When you're putting together a plan for Web applications and content databses in your environment, consider your expected usage patterns and how you expect your content databases to grow.
As a general rule of thumb, Microsoft recommends against growing content databases to larger than 200GB unless the content in the database meets specific non-collaborative usage criteria, such as that which is associated with single-site repositories and archives.
Databases that grow larger than the 200GB limit may cause performance degradation due to locking; they also represent a challenge from a backup and restore perspective.

Monday, July 11, 2011

Understand database mirroring requirements for disaster recovery purposes

SharePoint 2010 is mirroring aware and utilizes the FailoverPartner keyword in its database connection strings to identify a SQL Server instance that is used for mirroring purposes. Upon learning this, it might be tempting to jump right in and start mirroring SharePoint databases for redundancy. Before doing so, though, you should be aware that the following requirements apply:
  • Less than 1ms latency between principal and mirror SQL Server instances
  • 1GB/s bandwidth or greater between principal and mirror SQL Server instances
  • Principal and mirror instances must be running the same version and edition of SQL Server
  • Mirrored databases must use the Full recovery model
  • High safety with automatic failover (that is, synchronous mirroring with witness server) is recommended
Mirroring is certainly useful, but as the aforementioned list demonstrates: it shouldn’t be implemented without careful planning and infrastructure design.

Saturday, January 1, 2011

Export a list in SharePoint 2010 using PowerShell

If you want to export a list in SharePoint 2010 using PowerShell, you can
use the PowerShell cmdlet Export-SPWeb.

In this example, we export the document library “Documents” located in our
root site, including all versions and permissions.


Export-SPWeb http://youSPSite/ -path ”D:\backup\Documents.cmp”
`

-ItemUrl /Documents -IncludeVersions All -IncludeUserSecurity