Showing posts with label Tips and Tricks. Show all posts
Showing posts with label Tips and Tricks. Show all posts

Saturday, February 11, 2012

Large List Throttling over 5000 items in SharePoint 2010

If you are planning to upgrade from SharePoint 2007 to SharePoint 2010 -
you might want to consider your users that have list view lookups of over 5000 items and/or data column lookups of over 8 lookup columns. In SharePoint 2007, it was recommended not to go over 2000 list items to prevent poor performance on your farm.

In SharePoint 2010 throttling is enabled by default (This is configurable however in Central Administration). Throttlng is set to not display list view lookups of 5000 items or lists that have over 8 lookup columns.

The reason for this out of the box throttle is that if you are doing a lookup in SQL on less than 5000 rows, SQL executes a row level lock. If you execute a lookup with over 5000 items SQL executes a table lock which can potential impact all your site collections in that one ContentDB.

Here is a clever a SQL script to help audit your farms for these large lists and over 8 lookup columns - so you can warn your customers if they have any lists that will be throttled after you deploy SharePoint 2010.

SELECT
t3.fullurl [WEBURL],
t1.tp_title [LISTNAME],
COUNT(t1.tp_id) [ITEMCOUNT],
ISNULL(MAX(t4.lookupCount),0) [lookupCount]
FROM DBO.alllists t1
JOIN DBO.alluserdata t2 ON t2.tp_listID = t1.tp_id
JOIN DBO.webs t3 ON t3.id = t1.tp_webid
LEFT JOIN
(
SELECT siteID,listID,COUNT(listID) [lookupCount] FROM dbo.AllLookupRelationships
GROUP BY siteID,listID HAVING COUNT(listID) >= 8
) t4 ON t4.listID = t1.tp_id
WHERE t1.tp_title != 'User Information List'
GROUP BY t1.tp_id,t3.siteid,t3.fullurl,t1.tp_title
HAVING (COUNT(t1.tp_id) >= 5000 OR MAX(t4.lookupCount)>= 8)
ORDER BY 1;

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

Thursday, December 30, 2010

In case you want to Restrict the use of SharePoint designer in SharePoint 2010

SharePoint Designer 2010 has been significantly improved and we all use it,
however, there are still scenarios where you, as an administrator, will want to disable or restrict the use of SharePoint designer in your farm.
In SharePoint 2010, you are able to disable or restrict some of the features provided by SharePoint Designer on a Web Application basis.

Go to Central Administration -> General Application settings -> Configure SharePoint Designer settings. You can also configure these settings from the Application management in Central administration

Sunday, December 5, 2010

Office 2010 with MOSS 2007

In case upgrade to Office 2010 and still working with MOSS 2007, you face this problem, that I have just faced, all clients PCs can't open or save Office 2010 docuemnts to the portal, in my case the following step was the solution:
  1. Open up Internet Explorer
  2. Click Tools –> Internet Options
  3. Click the Connections tab
  4. Click LAN settings
  5. Check “Use a proxy server for your LAN enter the IP address
  6. Click Advanced
  7. In the Exceptions type: *.*
  8. Click OK, OK and OK

Saturday, December 4, 2010

Index and search for PDF documents with SharePoint 2010

SharePoint Server 2010, like its predecessors, includes indexing and search capabilities. But what doesn’t come out of the box is the ability to index and search for PDF documents.

PDF is a format owned by Adobe, not Microsoft. If you want to be able to find Adobe PDF documents, or have the PDF icon appear when viewing PDF files in a SharePoint document library , you will need to set it up for yourself,


1. Download and install Adobe’s 64-bit PDF iFilter http://www.adobe.com/support/downloads/detail.jsp?ftpID=4025
2. Download the Adobe PDF icon (select Small 17 x 17)
3. Give the icon a name or accept the default: ‘pdficon_small.gif’
4. Save the icon (or copy to) C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\14\TEMPLATE\IMAGES
5. Edit the DOCICON.XML file to include the PDF icon
6. In Windows Explorer, navigate to C:\Program Files\Common Files\Microsoft
Shared\Web Server Extensions\14\TEMPLATE\XML
7. Edit the DOCICON.XML file (I open it in Notepad, you can also use the built-in XML
Editor)
8. Ignore the section and scroll down to the section of the file
9. Within the section, insert attribute. The easiest way is to copy an existing one
10. Save and close the file
11. Add PDF to the list of supported file types within SharePoint
12. In the web browser, open SharePoint Central Administration
13. Under Application Management, click on Manage service applications
14. Scroll down the list of service apps and click on Search Service Application
15. Within the Search Administration dashboard, in the sidebar on the left, click File Types
16. Click ‘New File Type’ and enter PDF in the File extension box. Click OK
17. Scroll down the list of file types and check that PDF is now listed and displaying the pdf icon.
18. Close the web browser
19. Stop and restart Internet Information Server (IIS) Note: this will temporarily take SharePoint offline. Open a command line (Start – Run – enter ‘cmd’) and type ‘iisreset’
20. Perform a full crawl of your index. Note: An incremental crawl is not sufficient when you have added a new file type. SharePoint only indexes file names with the extensions listed under File Types and ignore everything else. When you add a new file type, you then have to perform a full crawl to forcibly identify all files with the now relevant file extension.

If you now perform a search, PDF files should be displayed in results where they match the search query, along with the PDF icon on display in results. The icon should also be visible in any document libraries that contain PDF files.

Good Luck

Wednesday, November 3, 2010

Move the Log

The SharePoint log files commonly referred to as the ULS logs are by default created in
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Logs.
These files can easily generate a lot of disk space—even if you  specify how many log files that should be stored.
You should always make sure that you move this location to any other disk you have available so you do not  run out of disk space on your c: drive and stop SharePoint from working..
This is done in Central administration -> Operations -> Diagnostics Logging

Tuesday, August 10, 2010

Configure Search on Sites Using Forms Authentication

The default SharePoint search crawler cannot crawl on sites that are set up to use Forms Authentication or sites that use a security certificate. 
Alternate Access Mappings provide an alternate URL to access the same SharePoint site and
can also be set to different zones such as Default, Intranet, Internet or Extranet.  Create an AAM to a site that cannot be crawled and assign it to the default zone. 
Set the authentication method for this mapped site to Windows  Authentication. 
This is configured via the ‘Create or extend Web application’ menu from Central Administration -> Application Management. 
The original site that cannot be currently crawled should be moved over to a zone other than the default zone.  The newly created AAM site can then be set to use Windows Authentication, should not use a Security Certificate and should be assigned to the default zone.

Tuesday, August 3, 2010

Backup & Restore Site Collections using PowerShell

SharePoint 2010 you can take a backup of a site collection using the
Backup-SPSite cmdlet:

Backup-SPSite
http://SP –Path C:\Backup\siteCollection.bak

Restoring a site collection in SharePoint 2010 is just as simple:

Restore-SPSite http://SP –Path C:\Backup\siteCollection.bak