Dec 11, 2014

SharePoint Foundation 2013: Missing search box? Unable to create webpart page?

If you've recently installed SharePoint Foundation 2013 SP1, you may have the following errors:
  • Missing search box
  • Error creating a web part page from IE11: Microsoft.SharePoint.SPException: Unable to create a web part page with the current browser. Browsers that allow web part page creation are Microsoft Internet Explorer versión 7.0 or later, Mozilla Firefox 3.0 or later and Apple Safari 3.0 or later. (translated from Spanish: Microsoft.SharePoint.SPException: No se puede crear una página de elementos web con el explorador actual. Entre los exploradores que admiten la creación de páginas de elementos web se encuentran Microsoft Internet Explorer versión 7.0 o posterior, Mozilla Firefox 3.0 o posterior, y Apple Safari 3.0 o posterior. )

The answer:  install the latest cumulative update package for SharePoint Foundation 2013

Dec 8, 2014

Create a Managed Copy from PowerShell

If you've ever tried to create a managed copy from PowerShell, you might have had some trouble updating the source CopyDestinations collection.  I certainly did until I learned I had to use an Assignment collection when opening the source SPWeb object.  Go figure. 

Credit goes to Ryan Spletzer:

Anyways, here's the code:
function CreateManagedCopy($sourceWebUrl,$sourceRelativeFileUrl,$destinationUrl) {
 Start-SPAssignment -AssignmentCollection $current
 $web = get-spweb $sourceWebUrl -AssignmentCollection $current
 $updatetype = [Microsoft.SharePoint.SPCopyDestinationType]::Update  
 $sourcefile = $web.GetListItem($sourceRelativeFileUrl);
 $sourcefile.CopyDestinations.Add($destinationUrl, $updatetype, "Copied from PowerShell")


# To call the function: 
# CreateManagedCopy "https://intranet/sites/test" "/sites/test/libA/test.docx" "https://intranet/sites/test/moveTo/test10.docx"