Gerald de Run's Blog

Scripting of SharePoint Configuration

During setup of MOSS/WSSv3 the SharePoint Products and Technologies Configuration Wizard is run to create a new configuration database and establish a new server farm, or connect to an existing configuration database joining the server to an existing farm.  There is a command line version of the configuration wizard called PSConfig.exe.  This binary can be found in %rcommonprogramfiles%\Microsoft Shared\Web server extensions\12\BIN.

The command line version of the configuration wizard can be used together with the Stsadm command-line tool to perform an unattended installation and configuration of MOSS/WSSv3. 
I wrote four command-line scripts that call PSCONFIG.EXE and STSADM.EXE to automate provisioning / un-provisioning of a Server Farm and Shared Services Provider:

  • MOSSInstall.cmd - Provisions a new server farm.
  • MOSSUninstall.cmd - Un-provisions an existing server farm.
  • SSPInstall.cmd - Provisions a new shared services provider.
  • SSPUninstall.cmd - Un-provisions an existing shared services provider.

The available commands for PSCONFIG.EXE are:

PSCONFIG.EXE -cmd setup [-lcid <1033>]
This performs SharePoint configuration setup based on the installation mode. If SharePoint is installed in a stand-alone mode, then stand-alone configuration is done.  If SharePoint is not installed in stand-alone mode, you must complete initial configuration setup by using the SharePoint Products and Technoligies Configuration Wizard windows application located in the start menu shortcut.

lcid: The LCID that specified the SharePoint installation language

PSCONFIG.EXE -cmd standaloneconfig [-lcid <1033>]
This command will perform a SharePoint stand-alone configuration.

PSCONFIG.EXE -cmd configdb
        [-create]
        [-disconnect]
        [-connect]
        [-server <SqlServerName>]
        [-database <SqlDatabaseName>]
        [-dbuser <value>]
        [-dbpassword <value>]
        [-user <Domain\User>]
        [-password <Password>]
        [-addomain <value>]
        [-adorgunit <value>]
        [-admincontentdatabase <SqlAdminContentDatabaseName>]
Creates, connects, or disconnects this server from the server farm.

  • Create: Creates a new configuration database and thus establishes a new server farm.  If this server is already connected to a configuration database, the server will be disconnected first, then the new configuration database will be created.
  • Disconnect: Disconnects this server from the configuration database and this disconnects this server from the server farm.
  • Connect: Connects to an existing configuration database and thus joins this server to an existing server farm.  If this server is already connected to a configuration database, the server will be disconnected first, then connected to the existing configuration database.
  • Server: The SQL server where the configuration database is located.
  • Database: The configuration database name.
  • Dbuser: The SQL Server user name used for SQL authentication.
  • DBpassword: The SQL Server password used for SQL authentication.
  • User: Server farm administrator user account.
  • Password: Server farm administrator user account password.
  • Addomain: Active Directory domain name used for the server farm.
  • Adorgunit: Active Directory organization unit name used for the server farm.
  • Admincontentdatabase: The Central Administration Web Application content database name.

PSCONFIG.EXE -cmd helpcollections -installall
This command manages help collections.

installall: Installs all available help collections.

PSCONFIG.EXE -cmd secureresources
This command will perform SharePoint resource security on this server.  For example, security is enforced on files, folders and registry keys.

PSCONFIG.EXE -cmd services
        [-install]
        [-provision]
This commnd can be used to manage SharePoint services

  • Install: Register the SharePoint services in the server farm that are located on this server.
  • Provision: Provisions the SharePoint services that are located on this server and sets the services as online if SharePoint is installed in stand-alone mode.  Provisioning services will also ensure that they are registered.

PSCONFIG.EXE -cmd installfeatures
This command will register the SharePoint features in the server farm that are located on this server.

PSCONFIG.EXE -cmd adminvs
        [-provision]
        [-unprovision]
        [-port <8080>]
        [-windowsauthprovider <enablekerberos | onlyusentlm>]
This command manages the SharePoint Central Administration Web Application on the local machine.

  • Provision: Provisions the SharePoint Central Administration Web Application on this server.  Provisioning will create a new SharePoint Central Administration Web Application virtual server and an application pool running under the server farm administrator's account.
  • Unprovision: Unprovisions the SharePoint Central Administration Web Application from this server.  Unprovisioning will remove the SharePoint Central Administration Web Application virtual server and its application pool.
  • Port: The SharePoint Central Administration Web Application port is a global setting to the server farm.  When changing the port, a SharePoint Timer service job will be dispatched to synchronize the port for all SharePoint Central Administration Web Applications in the server farm.  If a port is not specified, the port used for existing SharePoint Central Administration Web Applications in the server farm will be used.  If a SharePoint Central Administration Web Application has not been provisioned in the server farm, then the default port chosen will be random if a port is not specified.
  • Windowsauthprovider: The SharePoint Central Administration Web Application authentication provider is a global setting to the server farm.  When changing the authentication provider, a SharePoint Timer service job will be dispatched to synchronize the provider on all SharePoint Central Administration Web Applications in the server farm.  If onlyusentlm is specified, NTLM will be the exclusive authentication provider for all SharePoint Central Administration Web Applications.  All other authentication providers will be disabled and NTLM will be the only authentication provider allowed.  If enablekerberos is specified, Kerberos authentication will be enabled for all SharePoint Central Administration Web Applications.  If an authentication provider is not specified, the provider used for existing SharePoint Central Administration Web Applications in the server farm will be used.  If a SharePoint Central Administration Web Application has not been provisioned in the server farm, then the Kerberos authentication provider will be enabled if an authentication provider is not specified.

PSCONFIG.EXE -cmd upgrade
        [-wait]
        [-reghostonupgrade]
        [-finalize]
        [-inplace <v2v | b2b>]
        [-sidebyside]
This performs a SharePoint upgrade.  This command is automatically executed when running the SharePoint Products and Technologies Configuration Wizard if SharePoint needs to be upgraded.

  • Wait: If specified, the SharePoint Products and Technologies Configuration Wizard does not return until upgrade completed.  If not specified, the wizard returns after dispatching a SharePoint Timer service job to perform upgrade.  You can view the upgrade job status by accessing the SharePoint Central Administration Web Application using your Web browser.
  • Reghostonupgrade: If specified, the SharePoint Products and Technologies Configuration Wizard will revert all content streams during the upgrade.
  • Finalize: If specified, the SharePoint Products and Technologies Confiuration Wizard will finalize the current upgrade.  You will not be able to undo this action.
  • Inplace: If specified the SharePoint Products and Technologies Configuration Wizard will perform an in-place upgrade.  If v2v is chosen, then an in-place version to version upgrade will be performed.  If b2b is chosen, then an in-place build to build upgrade will be performed.
  • Sidebyside: If specified, the SharePoint Products and Technologies Wizard will perform a gradual upgrade.

PSCONFIG.EXE -cmd evalprovision -provision [-port <80>]
This performs stand-alone mode provisioning on this server.

  • Provision: Performs stand-alone mode provisioning on this server.
  • Port: The port number assigned to the default SharePoint Web Application.  If not specified, then port 80 is used.  If a SharePoint Web Application already exists using the port, the existing site will be overwritten.  If an existing site is using the port and is not a SharePoint Web Application, the site will be disabled and a new SharePoint Web Application will be created using the port.

PSCONFIG.EXE -cmd applicationcontent -install
This command manages shared application content.

  • Install: Copies shared application data (i.e. resource files, Web application binaries) to existing Web Application virtual directories.

PSCONFIG.EXE -cmd quiet
This command runs the SharePoint Product and Technologies Configuration Wizard in quiet mode.  Output is written to PSCONFIG.EXE_MM_DD_YYYY_HH_MM_SS_MS.log

Published Friday, January 11, 2008 8:35 AM by gderun

Attachment(s): Scripts.zip
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker