harbar.net component based software & platform hygiene

Scripts from my SharePoint Conference Sessions

Print | posted on Sunday, October 16, 2011 8:55 PM

As promised during my sessions at the SharePoint Conference in Anaheim last week, here are the Windows PowerShell scripts demonstrated.

Please note that these scripts are direct copies of those on my Virtual Machines. You *will* need to tweak them for use on your environments, and remember they are authored for the purposes of demonstration! If you wish to take pieces of them to use in a real deployment, they will need some work. The scripts are provided as is, without any warranties! You know the score.

SPC407: Enterprise Deployment Considerations for the User Profile Service Application.
These scripts create the UPA avoiding the Default Schema Issue even in UAC environments, and provision the UPS service instance. I will be posting a follow up to detail these in more depth in the next week or so.

UPADemos.zip

 

SPC370: Multi Tenancy with SharePoint 2010.
These scripts setup a multi-tenant environment from scratch. Before running them, you need a farm created, and the State Service and Usage and Health Data Collection Service Applications provisioned. The seventh part of my Multi Tenancy article series will be published soon.

MTDemos.zip

 

s.

Feedback

Gravatar

# re: Scripts from my SharePoint Conference Sessions

Thanks, mate. Much appreciated.

10/16/2011 9:20 PM | Rick Taylor
Gravatar

# re: Scripts from my SharePoint Conference Sessions

Be aware that when you spawn PowerShell processes up like that, they run with the default TheadOptions which is Multi Thread Appartment model (MTA).

The one thing that [sharepointroot]\CONFIG\POWERSHELL\Registration\SharePoint.ps1 do beside loading the SharePoint snap-in, is to set ThreadOptions to "ReuseThread", that forces the Runspace to run Single Thread Appartment model (STA).

Since SharePoint COM objects like SPRequest are not thread-safe, you should always ensure that your spawned PowerShell processes uses STA, either by setting

$Host.Runspace.ThreadOptions = "ReuseThread"

or by loading SharePoint.ps1 before you load your own code.

10/27/2011 9:04 AM | Anders Rask
Gravatar

# re: Scripts from my SharePoint Conference Sessions

Thank you - thumbs up :)
Great sessions at SPC 2011

11/5/2011 9:27 AM | Arnstein Fuglemsmo

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 8 and 8 and type the answer here: