Provision 2010 Farm without the Mess

Anyone who has created a new SP2010 Farm using the SharePoint Technologies Configuration Wizard will know that it makes a huge mess of SQL server, littering new databases with GUID extensions.

Those of you who have anal tendencies, like me, can sleep at night with nice clean database names with a script as follows:

Note: I am working on a script that will create Service Applications, which also like to create many GUID database instances.

@echo off

if "%1" == "" goto usage
if "%2" == "" goto usage

pushd C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14BIN
echo Creating New Farm Instance
psconfig.exe -cmd configdb -create -server %1 -database %2_SharePoint_Config -user DEVMOSS_Farm -password Sharepoint3 -passphrase Sharepoint3 -admincontentdatabase %2_SharePoint_Admin_Content

echo Creating Central Admin Site
psconfig.exe -cmd adminvs -provision -port 8000 -windowsauthprovider onlyusentlm

echo Installing Services
psconfig.exe -cmd services install

echo Securing Resources
psconfig.exe -cmd secureresources

echo Starting Search Service
stsadm.exe -o osearch -action start -role Index -farmcontactemail -farmperformancelevel maximum -farmserviceaccount "DEVMOSS_Farm" -farmservicepassword Sharepoint3

echo Starting WSS Search Service
stsadm.exe -o spsearch -action start -farmserviceaccount DEVMOSS_Farm -farmservicepassword Sharepoint3 -farmcontentaccessaccount DEVMOSS_Search -farmcontentaccesspassword Sharepoint3 -databaseserver %1 -databasename %2_WSS_App_Search

echo Installing Feature
psconfig.exe -cmd installfeatures

echo Installing Health Rules
psconfig.exe -cmd InstallHealthRules

goto end

echo "SP2010-Provision.bat <SQLServer> <Project Acronym>"