SharePoint 2010 Error Creating Sub-Sites: Unexpected error in Silverlight Application

If you see an “unexpected error in Silverlight application” error message when trying to create new sub-sites or other items on a SharePoint 2010 you need to check the web page security validation on your web application. Probably it is set to Off.

 

To change it:

  • Go to Central Administration.
  • Go to Application Management > Manage Web Applications.
  • Select the web application with the issue and click General Settings on the ribbon.
  • Change the Web Page Security Validation from Off to On.
  • Click OK to close the dialog.

Test the sub-site creation and the Silverlight should work just fine.

 

See you,

Amadeu.

Object Cache User Accounts and the ‘User does not exist or is not unique’ Error Message

Hi all.

SharePoint 2010 uses a cache to power publishing pages and web parts to reduce the load on the SQL Server databases, the latency and increase the throughput. In order to take advantage of this feature we need to configure the object cache user accounts: Portal Super User and Portal Super Reader.

The script to configure it is quite simple:

$wa = Get-SPWebApplication -Identity "http://yourwebapplicationurl.com"
$wa.Properties["portalsuperuseraccount"] = "SuperUser"
$wa.Properties["portalsuperreaderaccount"] = "SuperReader"
$wa.Update()

The trick part is what should be provided as the user names.

If you use Classic Mode Authentication you need to use the format DOMAIN\Username.

If you use Claims Based Authentication you need to use the format i:0#.w|DOMAIN\Username.

 

If you don’t specify a valid user name in the valid format you should see the following error message:

The user does not exist or is not unique.

 

This is a very generic error message but I was able to find the explanation on how to solve it on the post “SharePoint 2010: The user does not exist or is not unique“.

 

See you,

Amadeu.

Powershell Script to Change Page Layout on Publishing Pages

This is an useful script to change the Page Layout for all the publishing pages for a site.

$spWeb = Get-SPWeb("http://yourwebapplication.com/yoursite")
$pWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($spWeb)
$pSite = New-Object Microsoft.SharePoint.Publishing.PublishingSite($spWeb.Site);

$siteLayouts = $pSite.GetPageLayouts($false)
$myLayout = $siteLayouts["/_catalogs/masterpage/yourpagelayout.aspx"]
#$myLayout
$query = New-Object Microsoft.SharePoint.SPQuery
$query.ViewAttributes = "Scope='RecursiveAll'"

$pages = $pWeb.GetPublishingPages($query)

foreach ($page in $pages)
{
	if ($page.ContentType.Name -eq "Folder")
	{
		continue
	}

	$page.Layout = $myLayout
	$page.update()
	$page.ListItem.File.Publish("")
	$page.ListItem.File.Approve("")
}
$spWeb.Dispose()

Get the script file here.

Have fun!!!

See you,

Amadeu.