SharePoint Use Cases

27 Apr, 2012

SharePoint installation and maintenance slide decks from Windays 2012

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

This week I delivered a SharePoint session at Microsoft Windays 2012 Conference in Rovinj, Croatia. The session was on SharePoint 2010 – Installation and maintenance – best practices. If you are a novice SharePoint admin this could be good staring material for your SharePoint project.

12 Feb, 2012

Search with auto suggest for SharePoint lists – new version

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

Two years ago, while SharePoint 2010 was still in beta, I released Search Suggest for SharePoint 2010 lists. A number of people contacted me with various bug reports and feature suggestions. Finally, I found some time and refactored this old code to accommodate your suggestions.

Changes

  • Improvement: You can now define list columns (fields) to be queried
  • Improvement: You can now customize the display format
  • Fixed bug: Values from External Data Columns are not shown
  • Fixed bug: Web part is slow when querying a large list
  • Fixed bug: Trying to use a SPWeb object that has been closed or disposed and is no longer used.

Installation

Search AutoComplete for SharePoint Lists is a SandBox solution and can be deployed to any farm environment. If Sandbox solutions are disallowed for your site collection, contact your farm administrator.

UPGRADE: If you already have a previous version, uninstall it, and then re-add the solution.

  • Download and unpack solution package (it also available as open source project on CodePlex)
  • Go to your Site CollectionSite ActionsSite Settings
  • Browse GalleriesSolutions
  • Go to Solutions ribbon tab and click Upload Solution
  • Upload the WSP package you downloaded and Activate it
  • Open a SharePoint web page and Insert a web part
    (from CustomSearch AutoComplete for Lists)

Configuration

You can configure this web part via web part tool pane. Use the following settings from the Search section:

  • List name – Enter list name that you want to search
  • Display Fields Format – Enter fields whose value you want to display. Use static field names.
    Each field must be in square brackets. E.g. [FirstName] [Title] (phone [WorkPhone])
  • Query Fields – Fields that will be queried. Separate fields with semicolon. Use static field names. e.g. Title;FirstName;WorkPhone

Additional appearance options can be found in the Miscellaneous category.

Configuration Examples

The following table lists suggested configurations for default SharePoint lists (English template).

List Type Query Fields Display Fields Format Sample Output
Contacts Title; FirstName; WorkPhone [FirstName] [Title] (phone: [WorkPhone]) John Wayne (phone 816-555-1014)
Doc. Lib FileLeafRef [FileLeafRef] Sales Document.docx
Tasks Title [Title] Approve document
Links URL [URLNoMenu] http://bing.com, Bing.com

27 Jan, 2012

Add a user to the SharePoint_Shell_Access role for all SharePoint 2010 content databases

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

In order to use Windows PowerShell for SharePoint 2010 Products, a user must be a member of the SharePoint_Shell_Access, and you can do that via Add-SPShellAdmin cmdlet. However if user needs to work with a lot of content databases then you need to repeat this procedure over and over. Here is a simple script that will add a user to the SharePoint_Shell_Access role for all content databases.

if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
    Add-PSSnapin Microsoft.SharePoint.PowerShell;
}
cls
$username = Read-Host "Enter username";
Get-SPContentDatabase | ForEach-Object {Add-SPShellAdmin -UserName $username -database $_.Id}

30 Nov, 2011

How to enable alternate languages in Office365

Posted by: Toni Frankola In: Office365|SharePoint|SharePoint 2010  Bookmark and Share

Yesterday Microsoft announced Office365 (trial) availability in 22 additional countries (including Croatia :) ).

This blog post explains what you need to do in order to enable additional languages for the SharePoint site hosted in the Office365 environment:

  • Open your team site via browser.
  • Click on the Site Actions > Site Settings.
    SharePoint Site Settings - Office365
  • Navigate to the Site Administration > Language Settings.
  • Specify the alternate language(s) that this site will support
    Currently Office365 supports: Arabic, Basque, Bulgarian, Catalan, Chinese – Simplified, Chinese – Traditional, Croatian, Czech, Danish, Dutch, Estonian, Finnish, French, Galician, German, Greek, Hebrew, Hindi, Hungarian, Italian, Japanese, Kazakh, Korean, Latvian, Lithuanian, Norwegian, Polish, Portuguese, Portuguese – Brazilian, Romanian, Russian, Serbian – Latin, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian
  • Click OK.
  • From the User Settings menu, choose the desired language you want to use.
    User Settings > Change Language in Office365 - SharePoint

That’s it, your SharePoint site is now displayed in your desired language (the figure shows it in Croatian)

07 Nov, 2011

Building business forms with InfoPath 2010 and SharePoint 2010 – Slide decks

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

Two weeks ago I had a privilege to present at SharePoint Days 2010 at Bled, Slovenia. I delivered two presentations on Building business forms with InfoPath 2010 and SharePoint 2010. Here are my slides:

22 Oct, 2011

Introduction to SharePoint 2010 Sandboxed solutions development – Slides Decks

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

Few days ago I spoke at Advanced Technology Day 7 conference organized by Microsoft Croatia here in Zagreb.

You can find my slides below, all the samples are available for download on codeplex or here.

12 Oct, 2011

SharePoint 2010 links for new IT PROs (version 2011)

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

I am reposting my original post with new links and (+ some borrowed from Wictor Wilen class links).

————————-

I recently taught a couple of SharePoint 2010 readiness courses for new SharePoint IT PROs. Here are some links I usually email to them after the course:

(Please comment below if you think I should add something…)

General Links

Configuring User Profile Service

Recommended Reading

Installing SharePoint

Additional Learning Resources

Maintaining SharePoint systems

Forums

Useful SharePoint IT PRO Blogs

Various sites

PowerShell

ULS Log Viewer

Misc

09 Sep, 2011

SharePoint Days 2011, Slovenia

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

For third year in a row, I will be speaking at SharePoint Conference Slovenia. This time we are heading to beautiful alpine lake Bled.

Lake Bled, Slovenia

Lake Bled, Slovenia

I will have two sessions: Building business forms with InfoPath 2010 and SharePoint 2010 – Part1 and Building business forms with InfoPath 2010 and SharePoint 2010 – Part 2. Full schedule is available here. There will be a number of international speakers at the conference including: Claudio Brotto, Boris Gomiunik, Matjaž Perpar, Dejan Sarka, Robi Vončina, Uroš Žunič, Rok Bermež, Zlatan Dzinic, Joel Oleson, Paul J. Swider, Grega Jerkič, Tone Šivic and Michael Noel. Really looking forward to this conference!

Apply for the conference!

08 Sep, 2011

There was an error in communicating with Excel Calculation Services in SharePoint 2010

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

While working with a client yesterday we noticed users could not view Excel files in browser. A quick analysis of ULS logs revealed the following issue:

There was an error in communicating with Excel Calculation Services http://server_name:port/2a7905259ea644f3a2d8ebd2bcf1ee9f/ExcelService*.asmx exception: An error has occurred. ServerSession.GetNextServerHealthBased: There are no healthy servers although the number of available server in the farm is {1}; updated with no candidates available for the health based load balancing. The update duration was {0} millisecs.

Here is what you can do to fix this issue:

Hope this help!

26 Jul, 2011

Backup SharePoint 2010 site collections with PowerShell, send alerts and much more

Posted by: Toni Frankola In: SharePoint|SharePoint 2010  Bookmark and Share

Last year I wrote a PowerShell chapter for SharePoint 2010 Unleashed. One of the scripts that is available in the book allows you to easily backup SharePoint 2010 site collections. The Backup-SPSite cmdlet is available in SharePoint 2010 OOTB, but we wanted to show our readers you can do more with PowerShell.

Therefore this script allows you to:

  • Backup a single site collection or multiple site collections.
  • You can limit the number of backup files to keep (e.g. last 5 backups).
  • Once backup is completed, the administrator will be sent and e-mail with the information about the backup status, site collection size and backup file size.

Backuping just Site Collections is not enough to restore your entire farm, check SharePoint 2010 backup. You can document your SharePoint farm settings with our tool Documentation Toolkit for SharePoint.

Here are the examples how you can call the backup script:

# Backup all site collections in your farm
Get-SPSite -Limit All | ForEach-Object {Backup-SPSiteCollections -SPSiteID $_.ID -BackupFolder "C:\Backups\" -SiteName $_.Url -BackupFilesLimit 5 -Email "your-email@contoso.com" -SmtpServer "smtp.contoso.com"}
#
#Backup a site collection whose URL equals http://intranet.contoso.com
Get-SPSite | Where {$_.Url -eq "http://intranet.contoso.com"} | ForEach-Object {Backup-SPSiteCollections -SPSiteID $_.ID -BackupFolder "C:\Backups\" -SiteName $_.Url -BackupFilesLimit 5 -Email "your-email@contoso.com" -SmtpServer "smtp.contoso.com"}
#
#Backup all site collections whose URL is not equal to http://no-backup.contoso.com, no emails will be sent
Get-SPSite | where {$_.Url -ne "http://no-backup.contoso.com"} | ForEach-Object {Backup-SPSiteCollections -SPSiteID $_.ID -BackupFolder "C:\Backups\" -SiteName $_.Url -BackupFilesLimit 5}

You can also schedule this script to be run via Scheduled Task. The user running the scheduled task must have proper privileges to perform backup operations.

  • Create an action for scheduled task to Start a program.
  • Type powershell to Program/Script textbox.
  • Paste the full path to your script to Arguments textbox (e.g. C:\Scripts\BackupScript.ps1)

Backup SharePoint via PowerShell scheduled via Scheduled Tasks

Here is the entire script:

#
# SharePoint 2010 Unleashed - PowerShell SharePoint backup script
# http://www.amazon.com/Microsoft-SharePoint-2010-Unleashed-Michael/dp/0672333252
# Copyright: Toni Frankola
# Version: 1.1.0, Jul 2011.
#
# Source: http://www.sharepointusecases.com/?p=1597
# Licensed under the MIT License:
# http://www.opensource.org/licenses/mit-license.php
#
cls
if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {
	Add-PSSnapin Microsoft.SharePoint.PowerShell;
}
Function Backup-SPSiteCollections ()
{
	param(
		[Parameter(
			Position=0,
			Mandatory=$true
		)]
		[Guid]$SPSiteID,
		[Parameter(
			Position=0,
			Mandatory=$true
		)]
		[string]$BackupFolder,
		[Parameter(
			Position=0,
			Mandatory=$true
		)]
		[string]$SiteName,
		[Parameter(
			Position=0,
			Mandatory=$true
		)]
		[int]$BackupFilesLimit,
		[Parameter(
			Position=0,
			Mandatory=$false
		)]
		[string]$Email = "",
		[Parameter(
			Position=0,
			Mandatory=$false
		)]
		[string]$SmtpServer = ""
	)
	$siteNameSlug = $SiteName -replace "https://", ""
	$siteNameSlug = $siteNameSlug -replace "http://", ""
	$siteNameSlug = $siteNameSlug -replace ":", "-"
	$siteNameSlug = $siteNameSlug -replace " ", "-"
	$siteNameSlug = $siteNameSlug -replace "/", "-"
	$siteNameSlug = $siteNameSlug -replace "\.", "-"
	# Test if backup folder exists
	if (Test-Path $BackupFolder)
	{
		# Retrive previous backup files , sorted by last write time (last modified)
    	$files = Get-Childitem $BackupFolder | where {$_.Name -like ("*" + $siteNameSlug + "*.dat")} | Sort $_.LastWriteTime
    	$filesCount = @($files).Count
		# If there are more files in directory than backupFilesLimit
    	if($filesCount -ge $BackupFilesLimit)
    	{
			# Delete all older files
        	for ( $i=0; $i -lt $filesCount-$BackupFilesLimit+1; $i++)
        	{
            	Remove-Item ($BackupFolder + $files[$i].Name)
        	}
    	}
	}
	# If backup folder does not exist it will be created
	else
	{
		New-Item $BackupFolder -type directory
	}
    $backupFileName = ("" + $siteNameSlug + "_" + (Get-Date -Format yyyy-MM-ddThh-mm-ss) + ".dat")
    $backupFilePath = $BackupFolder + $backupFileName
	$startTime = Get-Date
    Backup-SPSite -identity $_.ID -path ($backupFilePath) -force
    $endTime = Get-Date
	# Checking if Email and SmtpServer values have been defined
	if($Email -ne "" -and $SmtpServer -ne "")
	{
		$subject = "SharePoint Site Collection Backup Completed!"
		$body = "The following site collection was backuped: " + $SiteName + "`n"
		$body += "Site collection was backuped to: " + $backupFileName + "`n"
		$body += "Backup started on: " + $startTime + ", and ended on: " + $endTime + "`n`n"
		# Retrieving Site Collection size
		$SiteCollectionSize = Get-SPSite "http://intranet.contoso.com" | Select @{Label="Size"; Expression={$_.Usage.Storage/1MB}} | Select Size
		# Retrieving backup file size
		$backupFileSize = Get-ChildItem $backupFilePath
		$backupFileSize = [Math]::Round($backupFileSize.length/1MB, 2)
		$body += "Site collection size on SharePoint system is: " + [Math]::Round($SiteCollectionSize.Size, 2) + " MB`n"
		$body += "Backup file size: " + $backupFileSize + " MB"
		$smtp = new-object Net.Mail.SmtpClient($SmtpServer)
		# Sending email
		$smtp.Send($Email, $Email, $subject, $body)
	}
}
# Backup all site collections in your farm
Get-SPSite -Limit All | ForEach-Object {Backup-SPSiteCollections -SPSiteID $_.ID -BackupFolder "C:\Backups\" -SiteName $_.Url -BackupFilesLimit 5 -Email "your-email@contoso.com" -SmtpServer "smtp.contoso.com"}
#Backup a site collection whose URL equals http://intranet.contoso.com
Get-SPSite | Where {$_.Url -eq "http://intranet.contoso.com"} | ForEach-Object {Backup-SPSiteCollections -SPSiteID $_.ID -BackupFolder "C:\Backups\" -SiteName $_.Url -BackupFilesLimit 5 -Email "your-email@contoso.com" -SmtpServer "smtp.contoso.com"}
#Backup all site collections whose URL is not equal to http://no-backup.contoso.com, no emails will be sent
Get-SPSite | where {$_.Url -ne "http://no-backup.contoso.com"} | ForEach-Object {Backup-SPSiteCollections -SPSiteID $_.ID -BackupFolder "C:\Backups\" -SiteName $_.Url -BackupFilesLimit 5}

About

Real-life use case and opinions about collaboration, CRM and web technologies and stuff by Toni Frankola. More...

Toni Frankola - SharePoint MVP Profile

All postings on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer.

Page optimized by WP Minify WordPress Plugin