Skip to main content

Scripted SharePoint Install

Doing a scripted install of MOSS can save a lot of time, and can also ensure that your installs are consistent.

Below is a sample scripted install of MOSS. (I have changed sensitive information like passwords, emails and URLS.)

I have found that it works best to execute these commands one at a time, rather than as a single script. If you are unlike me and never make mistakes, then feel free to run them all at once. Another added benefit is that this provides very nice documentation of your install for future posterity. And for someone who understands windows scripts can teach quite effectively what it takes to install MOSS, surely much more effectively than the beastly 30 page install instructions on MSDN.

One of my favorite benefits of a scripted install is that you can choose a name for the Central admin content database instead of getting stuck with the ugly content database name the includes a Guid. Some of the setproperty statements at the end are optional, but they give you an idea of how you can customize this script to make sure the same policies are applied across environments.

Credit for these scripts go to Ben Curry.

------------------------------

@echo off
REM //////////////////////////////////////////////////
REM // script farm -- creating dbs and setting sites /
REM //  sharepoint farm.                             /
REM //////////////////////////////////////////////////

REM //////////////////////////////////////////////////
REM // applications
REM //////////////////////////////////////////////////
set s="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe"
set ps="c:\program files\common files\microsoft shared\web server extensions\12\bin\psconfig.exe"

REM //////////////////////////////////////////////////
REM // your enterprise SQL server
REM //////////////////////////////////////////////////
set sql=TOPDEV

REM //////////////////////////////////////////////////
REM // account vars
REM //////////////////////////////////////////////////
set mossfarm=dev\mossfarm
set mosscrawler=dev\mosscrawler
set sspapid=dev\mosswebapp
set myapid=dev\mosswebapp
set sspservice=dev\mossfarm
set portalapid=dev\mosswebapp
set mossservice=dev\mossfarm

REM //////////////////////////////////////////////////
REM // password
REM //   NOTE:if using a % sign in password you must
REM //        escape it with a % sign 'iuyOP%%$#@!11'
REM //        is interpreted as 'iuyOP%$#@!11'
REM //       
REM //////////////////////////////////////////////////
set p=MyPasswordIsSomething

REM //////////////////////////////////////////////////
REM // additional settings
REM //////////////////////////////////////////////////
set sspportalurl=http://ssp.catapultdemo.com:81
set mysiteurl=http://my.catapultdemo.com:81
set portalurl=http://catapultdemo.com:81
set owneremail="joseph at email.com"
set ownername="Joseph Fluckiger"
set ownerlogin="dev\josephf"

REM //////////////////////////////////////////////////
REM // start work here
REM //////////////////////////////////////////////////

GOTO CURRENTSPOT
:CURRENTSPOT

Echo ===============================
Echo == Creating Farm
Echo ===============================
:: Creating Farm via populating the ConfigDB. Set SQL Servername, configDB name, Central Admin ContentDB, and Farm Account.
@pause
%ps% -cmd configdb -create -server %sql% -database SharePoint_Config_TOPDEV -user %mossfarm% -password %p% -admincontentdatabase SharePoint_Content_CentralAdmin
Echo ======================
Echo Provision Central Admin
Echo ======================
::  Provision Central Admin Application on this server. Uses configDB and ContentDB above. Set port number to suit your requirements.
@pause
%ps%  -cmd adminvs -provision -port 5000 -windowsauthprovider onlyusentlm
Echo ======================
Echo Install all Services
Echo ======================
::  Install all services on machine
@pause
%ps% -cmd services install
Echo ======================
Echo Securing File System and Registry Keys
Echo ======================
:: Set Security on File System and Registry Keys
@pause
%ps% -cmd secureresources
Echo ======================
Echo Starting MOSS Search
Echo ======================
::  Start SharePoint Server Search Service.Verify database and services names. Change role to Index, Query, or IndexQuery, depending on your farm topology.
@pause
%s% -o osearch -action start -role Indexquery -farmcontactemail %owneremail% -farmperformancelevel PartlyReduced -farmserviceaccount %mossservice% -farmservicepassword %p%
Echo ======================
Echo Starting WSS Search
Echo ======================
::  Start WSS Search. Verify database and service names.
@pause
%s% -o spsearch -action start -farmserviceaccount %mossservice% -farmservicepassword %p% -farmcontentaccessaccount %mosscrawler% -farmcontentaccesspassword %p% -databaseserver %sql% -databasename SharePoint_WSS_Search
Echo ======================
Echo Installing all Features
Echo ======================
::  Install all features on machine
@pause
%ps% -cmd installfeatures
Echo ======================
Echo Creating My Sites Web
Echo ======================
::  Create My Site Web application. Verify database name and administrator's names.
@pause
%s% -o extendvs -url %mysiteurl% -ownerlogin "%mossfarm%" -owneremail %owneremail% -exclusivelyusentlm -ownername "mossAdmin" -databaseserver %sql% -databasename SharePoint_Content_MySite -sitetemplate spsmsitehost -description "My Site Host" -sethostheader -apidname MySiteAppPool -apidtype configurableid -apidlogin %myapid% -apidpwd %p%
iisreset
Echo ======================
Echo Enabling Self Service Site Management for %mysiteurl%
Echo ======================
::  Enable Self Service Site Management (Creation) on %mysiteurl%
@pause
%s% -o enablessc -url %mysiteurl%
Echo ======================
Echo Creating SSP Web
Echo ======================
::  Create SSP Web application. Verify database and apid names. (APID = Application Pool Identity)
@pause
%s% -o extendvs -url %sspportalurl% -exclusivelyusentlm -databaseserver %sql% -databasename SharePoint_Content_SSP -donotcreatesite -description "SSP Admin Host" -sethostheader -apidname "SSP1" -apidtype configurableid -apidlogin %sspapid% -apidpwd %p%
::  We must reset IIS before building the SSP. If you are local on the box, you can check all services are created before creating SSP.
iisreset
Echo ======================
Echo Creating SSP
Echo ======================
::  Create SSP. Verify all names and URLs.
@pause
%s% -o createssp -title "SSP1" -url %sspportalurl% -mysiteurl %mysiteurl% -ssplogin %sspservice% -indexserver topdev -indexlocation "C:\Program Files\Microsoft Office Servers\12.0\Indexes" -ssppassword %p% -sspdatabaseserver %sql% -sspdatabasename SharePoint_SSP1_Config -searchdatabaseserver %sql% -searchdatabasename SharePoint_SSP1_Search -ssl no
Echo ======================
Echo Creating Portal
Echo ======================
::  Creating Portal.
@pause
%s% -o extendvs -url %portalurl% -ownerlogin %ownerlogin% -owneremail %owneremail% -ownername %ownername% -exclusivelyusentlm -databaseserver %sql% -databasename SharePoint_Content_catapultdemo -sitetemplate STS#1 -description "Catapult Demo Portal" -sethostheader -apidname "MossWebAppPool" -apidtype configurableid -apidlogin %portalapid% -apidpwd %p%
REM //////////////////////////////////////////////////
REM // POST BUILD
REM //////////////////////////////////////////////////
Echo ========================
Echo Modifying Logging level
Echo and Outbound Smtp
Echo ================calling setlogs.cmd====see premium content for xlsx source file=======
REM  or just set the logging levels in this script
@pause
%s% -o setlogginglevel -category general -tracelevel unexpected -windowslogginglevel error
%s% -o email -outsmtpserver topdev -fromaddress %owneremail% -replytoaddress %owneremail% -codepage 65001

Echo ========================
Echo Setting Application Settings
Echo Setting Recycle Bin Settings
Echo ========================
@pause
%s% -o setproperty -pn recycle-bin-enabled -pv yes -url %portalurl%
%s% -o setproperty -pn recycle-bin-enabled -pv yes -url %mysiteurl%
%s% -o setproperty -pn recycle-bin-retention-period -pv 180 -url %portalurl%
%s% -o setproperty -pn recycle-bin-retention-period -pv 180 -url %mysiteurl%
%s% -o setproperty -pn second-stage-recycle-bin-quota -pv 20 -url %portalurl%
%s% -o setproperty -pn second-stage-recycle-bin-quota -pv 20 -url %mysiteurl%

Echo ========================
Echo Setting Maximum Upload
Echo File Size
Echo ========================
@pause
%s% -o setproperty -pn max-file-post-size -pv 200 -url %portalurl%
%s% -o setproperty -pn max-file-post-size -pv 200 -url %mysiteurl%

Comments

Unknown said…
Awesome post. Just what I was looking for
Unknown said…
Hi, Thanks for your interesting blog. Keep up the great work! I also have a site & blog about Microsoft SharePoint developers, please feel free to visit.

Popular posts from this blog

How to Create and Run Tableau Bridge on Linux Containers

Tableau Bridge is now availble on Linux Containers. Yay! Now what does this mean and how do I build and run Linux Containers? We will discuss the advantages of running Bridge on Linux Containers the steps to build them, and finally, we will provide some automation script ideas for monitoring and scaling Linux Bridge agents. Tableau Bridge Today Until recently, Tableau Bridge was only available as a Windows application running on a Windows VM. It supported only one bridge agent per Virtual or Physical Machine. Advantages of Bridge in Containers Better Hardware Utilization: Linux containers are more efficient than Windows VMs, requiring only about 1/50th of the disk space. Ability to Spin Up Multiple Bridge Agents: With Linux Containers, it becomes easier to spin up multiple bridge agents on a single machine, improving scalability and resource utilization. Infrastructure Automation: Linux Containers enable easier automation of provisioning bridge agents and upgrading Tableau Bridge, the...

RAM Disks do not speed up Visual Studio

  The limiting factor for Visual Studio is disk IO. I got a tip to speed up Visual Studio from Channel 9 by creating a RAM disk which sounded like a great idea. However, when I ran a thorough set of tests, I found that the performance difference between the Ram disk and the hard disk were not appreciably different. This was a big surprise since RAM is 240,000 times faster than disk (see my previous blog post). But the reason is because Visual Studio and Vista do a lot of caching. So compile times for the same project in RAM disk and on hard disk were pretty similar. I also tested the time it took to search the entire solution for a word, and times to open a solution. There was no discernable difference!   If you still want to try it out and create your own RAM disk, you can download a simple RAMDISK.EXE utility to create a RAM disk in just a few minutes. What is a RAM Disk ?   Ramdisk is a virtual drive created in RAM.   Performance Analysis Creating f...

SpreadsheetGear vs. SyncFusion vs. ComponentOne

I conducted a three month analysis comparing three top spreadsheet controls for .NET application developers: SpreadsheetGear , SyncFusion Spreadsheet , and ComponentOne Spread.NET . The definite winner was SpreadsheetGear, with ComponentOne Spread.net in second. SpreadsheetGear provides the most Excel-like experience, is the most performant, and provides the most responsive and capable product support. I build a reporting engine for my company and SpreadsheetGear made it awesome. Our customers have been very pleased. I wanted to share my extensive analysis with any other developers out there trying to find the right spreadsheet control for their .NET application.   Comparison Spreadsheet gear grid goes to 1 million! Wow. (SyncFusion goes to 500 by default, ComponentOne goes to 60k) SpreadsheetGear is an older control which has been around for a while. It is built by the same guys who built Formula1, so they have been doing spreadsheets for many years. Sp...