Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

SharePoint 2010

Document Library Site Collections (DLSC)

Splitting a large site collection into many can make backups, storage scaling, and even development easier.   This is a pattern I like to call the DLSC or "Document Library Site Collection.”

A site collection starts our small at first, gets popular, explodes in size seemingly overnight, and the SharePoint admins scramble to support it.  Sound familiar?

It can be helpful to peel out a large Document Library into a dedicated site collection.   Then you have more options via PowerShell and SQL to manage backups.   Have five document libraries with 100GB each?  Fine, split them out to 5 site collections in 5 SQL databases.  Very manageable.

 

How To – Split a Document Library into a new Site Collection

1)  Make a new SQL content database (optional).   If you know LOTS of content will be coming, then give it room to grow now.

2)  Make a new blank site collection.   The below PowerShell command can help direct the site creation to a new database.   I like to use STS#1 for “Blank Site” because it has a minimal simple footprint.  Less is more.

New-SPSite http://sharepoint.com/sites/doclib -OwnerAlias “DOMAIN\Admin” -ContentDatabase WSS_Content_DocLib -Name “Document Library Site Collection” -Description “DLSC” -Template “STS#1″

3)  Export the source Document Library to CMP format

http://spdeploymentwizard.codeplex.com/  can be used for a friendly safe GUI to export with all the right options.  I like to enable checkboxes for ALL security, ALL versions, and ALL user info.

4)  Import the source Document Library to CMP format

http://spdeploymentwizard.codeplex.com/ can be used for the import too.

5)  Delete the original Document Library.

6)  Update and test navigation.  The biggest challenge with the DLSC model is navigation.  Things must be easy for users so they can’t tell the difference.   Be sure to update Top Link bar navigation.   I like to add a CEWP (Content Editor Web PArt) with a quick JavaScript to redirect folks back to the main “application” site.

 
Click here to return to AppSite

Downsides and Caveats

  • Manage two sets of security.  Yes, you’ll have to grant people permissions in two places.  Even using SPGroups won’t help because those are scoped to one site collection.  AD groups can help.  Those would be a great way to grant security to many site collections at once.   All about scale.  With only 2 sites AD groups probably aren’t worth the trouble, but with 20 it sure would help.
  • Sandbox code solutions. These only run in 1 site collection, so if you’re using them to manage documents and move those document libraries you could see issues.   The workaround would probably be to upgrade the code to a Central Admin farm WSP solution.
  • Dependency.   For some migrations you’ll need to copy ALL site collections.  If you copy just 1 then you may have broken links or missing dependencies.

 

Hope  this helps somebody else out there.  

Smile

 

image

 

image

 

image

Site Assets – enable Version History to sleep well at night

One thing I like to do on a newly created site is enable Version History for the “Site Assets” document library.  With many CSS and JS files supporting front end development, often those code files land here.  SharePoint Designer can be used to quickly check this setting.

 

image
image
image
image

“Site Pages” will have Version History enabled by default on newly created Team Sites.  That covers ASPX pages, but it can be smart to enable both for safety.

New Version of SSRS add-in released for SharePoint 2010

Today a new download showed up on my RSS feeds and I wanted to take a minute to compare this new MSI file against the trusty old MSI I’ve used for so long now.   As you know, the SharePoint 2010 Prerequisites installer requires “rsSharePoint.msi” to be loaded before you can install SharePoint 2010.   Below is the OLD link for SSRS which most people use today for cool stuff like a PowerShell script to download all Prerequisites for offline install. as well as the NEW link.   The release of Service Pack 2 for SQL 2008 R2 seems to be triggering lots of new downloads so it might be worthwhile to make sure you’re SharePoint front end binaries match the backend SQL server version.   If patching SQL to SP2, then it’s probably a good idea to update the web front end components and look for the “4000” version number.

 

NEW –
SP2
http://www.microsoft.com/en-us/download/details.aspx?id=62210.50.4000.07/27/201236.9 MB
OLD –
SP1
http://www.microsoft.com/en-us/download/details.aspx?id=2813210.50.2500.0011/3/201136.9 MB

 

It might be a good idea to download the most recent add-in for any new server installs.  There appear to be updates to most all files, but “sqlserverspatial.dll” grew more than most possibly hinting at better geographic data support.

 

image

 

Old Package – File Version Detail

image

 

New Package – File Version Detail

image

 

\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Admin\ReportServer\reportserverproperties.aspx
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Admin\ReportServer\reportserversitesettings.aspx
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverrsaction.aspx
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverrsintegrationresults.aspx
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverrsviewerpage.aspx
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserversitelevelsettings.aspx
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1025sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1026sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1027sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1028sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1029sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1030sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1031sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1032sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1033sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1035sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1036sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1037sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1038sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1040sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1041sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1042sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1043sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1044sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1045sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1046sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1048sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1049sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1050sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1051sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1053sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1054sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1055sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1058sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1060sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1061sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1062sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1063sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles1087sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles2052sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles2070sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles2074sqlrvdefault.css
\Program Files\Common File\Mmicrosoft Shared Web\Server Extensions\14\Template\Layouts\reportserverstyles3082sqlrvdefault.css
\Program files\Microsoft SQL Server\100\keyfile1033rssharepoint_keyfile.dll
\Windows\GAC\microsoft.reportingservices.sharepoint.ui.serverpages.dll
\Windows\GAC\microsoft.reportingservices.sharepoint.ui.webparts.dll
\Windows\GAC\microsoft.sqlserver.types.dll
\Windows\GAC\rssharepointsoapproxy.dll
\Windows\GAC\_32microsoft.sqlserver.types.dll
\Windows\System32\sqlserverspatial.dll
\Windows\SysWOW64\sqlserverspatial.dll

EmptyList.ps1 – delete all SharePoint list items with PowerShell

Recently I needed to empty an InfoPath Form Library by deleting all of the items and skipping Recycle Bin.  Datasheet view is great for small lists (a few hundred rows) but it doesn’t perform as well on large lists.  Also, skipping the Recycle Bin is a unique requirement best handled with server side code.  See the below PowerShell script for how to easily “empty” any SharePoint list or library.  This works with both SharePoint 2010 and SharePoint 2007 (MOSS 2007).  NOTE – Use this script carefully, it is really good at deleting. 

Smile
# SharePoint On-Premise
Add-PSSnapIn Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null
$web = Get-SPWeb "http://sitename/"
$list = $web.Lists["Shared Documents"]
$caml=""
#optional filter
$query=new-object Microsoft.SharePoint.SPQuery
$query.ViewAttributes = "Scope='Recursive'"
$query.Query=$caml
$items=$list.GetItems($query)
Write-Host $items.Count
$items | % { $list.GetItemById($_.Id).Delete() }
$web.Dispose()
$site.Dispose()

# SharePoint Online (SPO)
$webUrl = "https://tenant.sharepoint.com/sites/team"
$listTitle = "Shared Documents"
Connect-PnPOnline –Url $webUrl -UseWebLogin
$l = Get-PnPList $listTitle
$items = Get-PnPListItem -List $listTitle -PageSize 500
$batch = New-PnPBatch
foreach ($item in $items) {
$item.ID
Remove-PnPListItem -List $l -Identity $item.Id -Batch $batch
}
Invoke-PnPBatch -Batch $batch

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲