SharePoint Use Cases

27 Jan, 2012

Add a user to the SharePoint_Shell_Access role for all 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}

21 Jul, 2011

Documentation Toolkit for SharePoint – our new product

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

After many months of development I am happy to announce that we have finally released Documentation Toolkit for SharePoint. Two years ago I realized I really do not want to document SharePoint farms I deploy for customers by taking screenshots or typing settings to a Word document. I wanted to have an application that would go inside the SharePoint farm and grab all the settings and store these to a Word document so that I could polish and send it to a customer along with the invoice for the service provided.

Here is what the generated document looks like:

Generate SharePoint Farm Documentation

This is a commercial application and it is licensed:

I hope you will like the application, your feedback is much appreciated. I will try to post some useful guides and scenarios on this blog on how to use the app.

Useful links

18 Jul, 2011

SharePoint Columns – Features and limitations

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

SharePoint list columns are very easy to use and configure. However when working with customers you will hear many different questions related to columns e.g.: “Can I edit managed metadata column in datasheet view?”.

I made the following table for my own reference and I am sharing it with you. The table lists features and limits of SharePoint columns related to various questions you might be asked.

Column Type Ad-hoc filter & sort Edit in Datasheet view Use in calculated columns Use for Lookup columns
Single line of text yes Yes yes Yes yes Yes yes Yes
Multiple lines of text No No No No
Choice yes Yes yes Yes yes Yes No
Number yes Yes yes Yes yes Yes yes Yes
Currency yes Yes yes Yes yes Yes No
Date and Time yes Yes yes Yes yes Yes yes Yes
Lookup yes Yes yes Yes No yes Yes

(Use only to count number of items)

Lookup (projected field) yes Yes N/A No No
Yes/No yes Yes yes Yes yes Yes No
Person or Group yes Yes yes Yes

(No people picker)

No No
Hyperlink or Picture yes Yes yes Yes No No
Calculated yes Yes N/A No yes Yes
External Data yes Yes No yes Yes No
External Data (projected field) yes Yes N/A yes Yes yes Yes
Managed Metadata yes Yes No No No
(Special) ID yes Yes N/A No No
(Special) Created By yes Yes N/A No No
(Special) Created On yes Yes N/A yes Yes yes Yes
(Special) Modified By yes Yes N/A No No
(Special) Modified On yes Yes N/A yes Yes yes Yes
(Special) Version yes Yes N/A No yes Yes

Tags:

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