Welcome to MSDN Blogs Sign in | Join | Help

SharePoint Brew

Russmax [MSFT] weblog
SharePoint 2010 Multi-Tenant Hosting Part 2 “Configuring”

Part 2 - Configuring Hosting

Configuring hosting requires powershell so the steps are all based off of using it.

1. Create a subscription and assign sites to it:

$sub = new-spsitesubscription

$sub  

2. Pulling the site collection or set of site collections you wish to join to the site group:

get-spsite

$site = get-spsite | where {$_.url -eq "http://contoso"}

$site

​Now you have two variables.  Variable 1 $sub object contains a new spsitesubscription.  Variable 2 $site contains a site collection.

3. Add  the site collection $site, to the newly created site subscription $sub.

set-spsite -identity $site -sitesubscription $sub

Check whether it has been added correctly by doing the following:

get-spsitesubscription

If a database ID exists, then you can type the following

get-spdatabase | where-object {$_.id -match "full or partial guid"}

Will output the results of the associated site collection.

 

4. Create a secondary subscription and associate a different site collection within same web application for demonstration purposes using the steps above.

5. Create a SubscriptionSettings Service Application and Proxy

A.  Start the WSS Subscription Settings Service

B. Create Service Application and Proxy via PowerShell

$appPool  =  New-SPIISWebServiceApplicationPool -Name SettingsServiceApppool -Account domain\use

$sa = new-spsubscriptionsettingsserviceapplication –Name SubscriptionSettingsServiceApplication –Databasename SubscriptionSettingsServiceApplicationDB –applicationpool $appPool

$sap = new-SPSubscriptionSettingsSericeApplicationProxy –ServiceApplication $sa

6. Creating the Tenant Admin Site for each site group

$sub = get-spsitesubscription –identity “http://server”

$tasite = new-spsite –url “http://Contoso/sites/tasite1” –template “tenantadmin#0” –owneralias domain\username –sitesubscription $sub

7. Provision a search service application in hosting mode.  Please see the Configure Search Service application using Powershell blog.

8. Feature's and hosting

Once a feature has been installed into the farm, it's available to all sites and can be activated through manage features pages.  The way to control this in a hosting scenario is you only provide the features available to a given site group through various PowerShell commands.  Any features not listed are excluded and not available for all site collections that belong to the corresponding site group.  Steps are below:

Create a feature set: 

$fs =New-SPFeatureSet

Adding features to a feature set:  

$farm = Get-SPFarm

$feature1 =$farm.FeatureDefinitions | where{$_.ID -eq "02464c6a-9d07-4f30-ba04-e9035cf54392"}

Add-SPFeatureSetMember -Identity $fs -FeatureDefinition $feature1

Adding feature set to subscription:

Set-SPSiteSubscriptionConfig -Identity $sub -FeatureSet $fs

Posted: Tuesday, October 20, 2009 7:24 PM by Russmax

Comments

Ryan said:

I'm getting the following error when trying to run this command. Any ideas?

------------------

$sa = new-spsubscriptionsettingsserviceapplication –Name SubscriptionSettingsServiceApplication –Databasename SubscriptionSettingsServiceApplicationDB –applicationpool $appPool

-------------------------------------

New-SPSubscriptionSettingsServiceApplication : Object reference not set to an i

nstance of an object.

At line:1 char:51

+ $sa = New-SPSubscriptionSettingsServiceApplication <<<<  -Name SubscriptionSe

ttingsServiceApplication -Databasename SubscriptionSettingsServiceApplicationDB

-applicationpool $appPool

   + CategoryInfo          : InvalidData: (Microsoft.Share...viceApplication:

  SPCmdletNewSubs...viceApplication) [New-SPSubscript...viceApplication], Nu

 llReferenceException

   + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSubsc

  riptionSettingsServiceApplication

# November 25, 2009 3:12 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker