1. Connecting and Disconnecting Servers with Windows PowerShell
What if you want to scale out and add more servers to your farm? This can be accomplished using the Connect-SPConfigurationDatabase
cmdlet. When using the cmdlet, you need to specify the configuration
database name, database server, and the passphrase you used when you
created the farm (as in the previous example).
PS > $securePassPhrase =
>> (ConvertTo-SecureString -String "pass@word1" -AsPlaintext -Force)
PS > Connect-SPConfigurationDatabase -DatabaseName "NimaIntranet_ConfigDB" `
>> -DatabaseServer "SQLServer01" -PassPhrase $securePassPhrase
If you are unsure of the name of your configuration database, you can use the Get-SPFarm cmdlet to retrieve it (on a server that is already part of the farm):
The counterpart to the Connect-SPConfigurationDatabse cmdlet is the Disconnect-SPConfigurationDatabase cmdlet. The Disconnect-SPConfigurationDatabase cmdlet differs from the Connect-SPConfigurationDatabase
cmdlet in that you do not need to specify the configuration database
name, farm administration account name, or passphrase. You simply need
to make sure that the account you execute the command as has sufficient
permissions. The cmdlet detects to which configuration database the
server is connected.
PS > Disconnect-SPConfigurationDatabase -confirm:$false
The confirm parameter is a switch
parameter. If it’s omitted, you will need to confirm that you want to
take the action before it will be performed by the cmdlet.
2. Additional Functionality in SharePoint 2010
After
the binaries are installed for SharePoint 2010, you will notice that
the Start menu on your server includes an application group named
Microsoft SharePoint 2010 Products. Here, you will find the SharePoint
2010 Products Configuration Wizard, which guides you through essentially
the same steps we have gone through using Windows PowerShell, but using
a graphical interface rather than cmdlets. If you have worked with
SharePoint products before, you find this interface familiar. (One
difference is the new Passphrase dialog box, which appears if you have
not selected the Standalone option during the installation of the
binaries.)
The SharePoint 2010 Products Configuration
Wizard could be run as an alternative to a scripted installation or when
patching the environment with a cumulative update or service pack. With
the wizard, you are also able to connect and disconnect servers from
your farm, as shown in Figure 1.
Psconfig.exe is the command-line version of the SharePoint 2010 Products Configuration Wizard tool, which can be found in the %COMMONPROGRAMFILES%\Microsoft Shared\Web Server Extensions\14\BIN folder. With psconfig.exe,
you are able to run command lines in a script and provision a
SharePoint 2010 farm. However, PowerShell has clear advantages
when you have several different farm configurations and need to
reprovision those different versions regularly. This is quite common for
organizations that have a SharePoint framework consisting of different
staging environments like a development farm, a test farm, a user
acceptance testing (UAT) farm, and one or many production farms. Using psconfig.exe
and Windows command batch files, you would need to create separate
scripts with hard-coded values. With Windows PowerShell, you can create
one script and multiple configuration files—most likely in XML, as it is
extremely easy to work with in Windows PowerShell.
If you have psconfig.exe scripts
for provisioning a SharePoint 2007 farm, it’s quite possible they will
work with SharePoint 2010, with no or minimal changes. However, we
recommend that you look into changing your old scripts so that they use
Windows PowerShell, since almost all scripts you will create from now on
will be Windows PowerShell scripts. This will help you create a unified
script library based on the same language.