Welcome to MSDN Blogs Sign in | Join | Help

Eric Kraus' SharePoint/.NET Blog

What the field says about MOSS.

News

  • Subscribe to this blog


    Eric Kraus on Live Messenger




      Disclaimer
      These postings are provided "AS IS" with no warranties and confer no rights. In addition, these postings are my own and do not represent the views of Microsoft.
    SharePoint 2010 Provisioning A New Farm with PowerShell

    <Update 2009.11.20  Added Initialize-SPResourceSecurity
    and Install-SPApplicationContent  Thanks, Zach>

    This post will take you down the process of configuring your SharePoint farm while introducing the new administrative functionality shipping in the PowerShell provider.

    During the SharePoint Installation, make sure you choose “Server Farm” and then “Complete” install.  This will allow you to create a SharePoint farm rather than a standalone server.

    After the install completes, the setup program will ask you if you want to run the SharePoint Technologies Configuration Wizard (default is checked).  Uncheck the box to NOT run the wizard.

    Under the Start Menu, browse to Microsoft SharePoint 2010 Products.  Right-click on SharePoint 2010 Management Shell and choose Run as administrator

    0_StartPowerShell

    Notice:
    Since we have not created a farm yet, the shell will load with an error that the local farm is not accessible.  This is expected.

    Next, run the following command to create a new configuration database and central admin content database.  The main reason we are using this method, versus the GUI is because we can specify the central admin content database name.  (In the GUI, you cannot specify the name and it is created with a GUID)  <—DBA’s hate this

    New-SPConfigurationDatabase –DatabaseName “SharePoint2010_Config” –DatabaseServer “<db server>” –AdministrationContentDatabaseName “SharePoint2010_Admin_Content” –Passphrase (ConvertTo-SecureString “pass@word1” –AsPlaintext –Force) –FarmCredentials (Get-Credential)


    Notice: rather than hard coding the credential for the farm account, I am having PowerShell prompt me for it.  You can also do this with the passphrase by accessing the “Password” property of the of the credential object:  (Get-Credential).Password 

     


    1_NewConfigDB

    After the process runs, you can test that the server has not been added to a farm, by reloading the PowerShell window.  Close and repeat the “Run as administrator” step above.  It should load with no warning message.

    5_ReloadShowsFarmConnected

    Next, we need to provision the central admin web application on our desired port.  This will also link up the web application with the admin content database we created in the previous step.

    New-SPCentralAdministration -Port 1234 -WindowsAuthProvider "NTLM"

    Next, we want to install all of the help files within Central Admin

    Install-SPApplicationContent

    After that command completes, we need to secure the files and registry entries on the server otherwise we we will receive a whole bunch of weird security errors. 

    Initialize-SPResourceSecurity

    Next, we need to install the features on the server. 

    Install-SPFeature –AllExistingFeatures

    21_InstallFeatures

    Lastly, we need to install and and then provision the services onto the farm.

    Install-SPService

    Install-SPService  -Provision  (for standalone servers only)

    One of the last steps that I perform here is to Disable the Loopback Check on stand alone demo servers.  This setting usually kicks out a 401 error when you try to navigate to sites that resolve to a loopback address e.g.  127.0.0.1

    To disable the loopback check, run this command from PowerShell:
    New-ItemProperty HKLM:\System\CurrentControlSet\Control\Lsa -Name "DisableLoopbackCheck"  -value "1" -PropertyType dword


    DONE!  Now, you can open up Internet Explorer to the central admin site/port you specified and you’re on your way!

    Or, since you’re now a PowerShell pro, run this command : 
    “start iexplore http://server:1234”
    Posted: Friday, November 06, 2009 3:35 PM by ekraus

    Comments

    donal.conlon said:

    Just what I was looking for.  Thanks!

    When I run "Install-SPFeature –AllExistingFeatures" I get an error for  Feature OSearchCentralAdminLinks\Feature.xml:

    WARNING: Feature OSearchCentralAdminLinks\Feature.xml had failed to install for

    the following reason: Object reference not set to an instance of an object..

    WARNING: Feature SharedServices\feature.xml had failed to install for the

    following reason: Office Server service not found..

    Any thoughts?

    # November 22, 2009 9:40 AM

    donal.conlon said:

    Install-SPService -Provision seem to only work for Standalone mode.  

    # November 22, 2009 3:33 PM

    donal.conlon said:

    Me again.  So I ran all the commands, but the Install-SPService -Provision command will not run, on amything other than standalone mode.

    So how do i configure my services?  I go to the Service Applicaotn page in CA, but the 'New' does not do anything.  No drop-down off all the service types.

    What gives?

    # November 22, 2009 8:37 PM

    donal.conlon said:

    Ok, so If I just run Install-SPService (without -Provision), it will install the services, and then I can provision from the UI!

    # November 22, 2009 8:51 PM

    ekraus said:

    Sorry, the post has been updated now.  You need to run Install-SPService  and then the second time add in the -Provision switch to actual provision them.

    -Eric

    # November 23, 2009 5:53 AM
    Anonymous comments are disabled
    Page view tracker