SharePoint 2010 Products scripted deployment

It seems I missed it when Microsoft published the SPModule PowerShell module to aid in a scripted installation of a SharePoint 2010 farm.

If anything, it can serve as a handy guide for how to script out individual actions pertaining to installation and farm maintenance.

Reference

SharePoint 2010: Provisioning a new Farm with Powershell

SharePoint 2007 always required some level of scripting in it’s installation to allow for greater control of the installation process (i.e. creating database names without GUIDs). SharePoint 2010 is not any different in that scripting is still required to gain the finer control over installation. What has changed is that now PowerShell can be used in place of psconfig/stsadm. With that in mind, let’s begin.

  1. Install the SharePoint binaries on each server in your farm. Select “Complete” as the installation type. This will allow you to create a farm as opposed to a single server installation.After the install has completed, you will asked if you would like to complete the “SharePoint Products Configuration Wizard”. Do not run the wizard at this time.
  2. On the server which you wish to provision Central Administration:
    1. Open the  ”SharePoint 2010 Management Shell” (right-click and select “Run as administrator”). The shell will load with a message that the local farm is not accessible. This is expected as we have only installed the binaries.
    2. Run the following command to create the initial configuration/content database for the farm.
      New-SPConfigurationDatabase –DatabaseName “SharePoint2010_Config” –DatabaseServer “SharePoint2010SQL” –AdministrationContentDatabaseName “SharePoint2010_Content_Admin” –Passphrase (ConvertTo-SecureString “Pass@word1” –AsPlaintext –Force) –FarmCredentials (Get-Credential)
      
    3. After the initial creation of the farm, close and reload the “SharePoint 2010 Management Shell”. You should no longer receive any error messages.
    4. Install the help files.
      Install-SPHelpCollection -All
      
    5. Secure the resources used by the server (files and registry).
      Initialize-SPResourceSecurity
      
    6. Install and provision the farm services.
      Install-SPService
      
    7. Install the features on the server.
      Install-SPFeature –AllExistingFeatures
      
    8. Provision Central Administration.
      New-SPCentralAdministration -Port 1234  -WindowsAuthProvider "NTLM"
      
    9. Install the application content.
      Install-SPApplicationContent
      
    10. Optional: Disable the loopback check. If this is a development install, outright disabling the check should be fine. For production environments, the loopback check should be left in place and BackConnectionHostNames should be used in its place. See KB 896861.
      New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck"  -value "1" -PropertyType dword
      
  3. On each additional server that you wish to converge in the farm:
    1. Open the  ”SharePoint 2010 Management Shell” (right-click and select “Run as administrator”). The shell will load with a message that the local farm is not accessible. This is expected as we have only installed the binaries.
    2. Connect the server to the farm with the following command:
      Connect-SPConfigurationDatabase -DatabaseName "SharePoint2010_Config" -DatabaseServer "SharePoint2010SQL" -Passphrase (ConvertTo-SecureString "Pass@word1" -AsPlaintext -Force)
      
    3. Install the help files.
      Install-SPHelpCollection -All
      
    4. Secure the resources used by the server (files and registry).
      Initialize-SPResourceSecurity
      
    5. Install and provision the farm services.
      Install-SPService
      
    6. Install the features on the server.
      Install-SPFeature –AllExistingFeatures
      
    7. Install the application content.
      Install-SPApplicationContent
      
    8. Optional: Disable the loopback check. If this is a development install, outright disabling the check should be fine. For production environments, the loopback check should be left in place and BackConnectionHostNames should be used in its place. See KB 896861.
      New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck"  -value "1" -PropertyType dword
      

Reference

SQL server at DATABASESERVER has an unsupported version 10.0.2531.0

Attempting to run the SharePoint 2010 Configuration Wizard through PowerShell (New-SPConfigurationDatabase) yielded the following error:

New-SPConfigurationDatabase : SQL server at CLSHPT2010SQL has an unsupported version 10.0.2531.0. Please refer to “http://go.microsoft.com/fwlink/?LinkId=165761″ for information on the minimum required SQL Server versions and how to download them.
At line:1 char:28

I had never installed the latest cumulative update for SQL Server 2008 after completing my cluster configuration. The fix is simple. Install the Cumulative update package 2 for SQL Server 2008 Service Pack 1 (KB970315).

Reference

Getting Started With Windows PowerShell and SharePoint

Today was my first experience with PowerShell, and I have to say I’m impressed.  PowerShell truly does appear to be a command prompt for the .NET generation.  While it can be agravating at times, I can see PowerShell quickly becoming a “can’t do without” tool in my arsenal.

Resources: