Site Subscriptions in SharePoint 2010
Site Subscriptions in SharePoint 2010
New multi-tenancy features are an exciting concept in SharePoint 2010, particularly when considering the implications on hosting SharePoint for a variety of tenants, each requiring some method of partitioning, administration, and a method of reporting and control whether within the boundaries of an Enterprise or as a hosting provider. In this post we’ll look at one of the layers of multi-tenancy in SharePoint 2010.
SharePoint 2010 provides support for a concept known as site subscriptions. Site subscriptions can be loosely described as a collection of sites that subscribe to a set of service partitions, settings, and individual features – site subscriptions are also known as tenants. In summary we can approach site subscriptions as a loose association of content. In the Object Model site subscriptions are represented through Microsoft.SharePoint.SPSiteSubscription.
The management of site subscriptions occurs through a new administration site template, Tenant Administration, that is used to manage many aspects of the site collections that subscribe from the subscription.
Creating a new site subscription object in SharePoint Server 2010 requires an administrator to:
- Create a SPSiteSubscription object
- Create and add a SPSite object to the SPSiteSubscription
Included below are both Windows PowerShell and Object Model examples that will enable the creation, assignment, identification, and deletion of site subscriptions in SharePoint 2010.
Creating Site Subscriptions with Windows PowerShell
Create a Site Subscription
Create a Tenant Administration Site
$site=New-SPSite –Url http://
Optionally when using an existing Tenant Administration site you can use:
Set-SPSite –Identity $site –SiteSubcription $subscription
Assign the Tenant Administration Site
Set-SPSiteAdministration –Identity http://
Upon completion of the steps above (or below) you will have a new Tenant Administration site collection that will appear similar to the illustration below (click to enlarge).
On the Tenant Administration site collection select Manage Site Collections under SharePoint Sites to manage the properties of existing site subscription member site collections or add new sites to the site subscription (requires Self-Service Site Creation to be enabled on the Web application).
Creating Site Subscriptions through the Object Model
// Get an existing Tenant Administration Site
using (SPSite site = new SPSite("http://<server>/
// Create a Site Subscription
SPSiteSubscription subscription = SPSiteSubscription.CreateSubscription(); // Add the Tenant Administration Site to the Site Subscription
Locating a Site Subscription with Windows PowerShell
Get-SPSiteSubscription –Identity http://
Optionally to get all site subscriptions you can use:
Location a Site Subscription through the Object Model
The SPFarm.SiteSubscriptions property can be used to get all site subscriptions available in the farm. For additional information on the SPFarm.SiteSubscriptions property see also http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spfarm.sitesubscriptions(office.14).aspx.
The SPSite.SiteSubscription property can be used to get the site subscription that the Site Collection is assigned. For additional information on the SPSite.SiteSubscription property see also http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.sitesubscription(office.14).aspx.
The SPContext.SiteSubscription property can be used to get the site subscription that the site collection is assigned. For additional information on the SPContext.SiteSubscription property see also http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontext.sitesubscription(office.14).aspx.
Deleting a Site Subscription with Windows PowerShell
Remove-SPSiteSubscription -Identity //">//">http://
Optionally to delete all site subscriptions you can use:
Get-SPSiteSubscription | Remove-SPSiteSubscription
Deleting a Site Subscription through the Object Model
// Get the Tenant Administration Site
using(SPSite site = new SPSite("http://<server>/
SPSiteSubscription subscription = site.Subscription;
Backing up a Site Subscription
The last scenario in this post to managing site subscriptions is the backup scenario. The following Windows PowerShell examples can be used to backup and restore site subscriptions.
Get the Site Subscription Id
Backup all Site Collections in the Site Subscription
Backup the Site Subscription Settings
Export-SPSiteSubscriptionSettings –id $id –path “\