SharePoint: Let PSConfig and STSADM setup your MOSS

This is eight in the series on MOSS Scripted Installation (SQL Express Edition)

Lets get our hands dirty and use psconfig and stsadm to do the configuration that we want!

Earlier we have seen this bit, wherein you don’t run the configuration wizard and run these commands from a batch file

psconfig.exe -cmd configdb -create

psconfig -cmd helpcollections -installall

psconfig -cmd secureresources

psconfig -cmd services -install

psconfig -cmd installfeatures

psconfig -cmd adminvs -provision -port 8000 -windowsauthprovider onlyusentlm

psconfig -cmd applicationcontent -install

Now lets get further down in the script

**SetupServices**
stsadm -o osearch -action start -role indexquery -farmcontactemail email@yourdomain.com -farmserviceaccount domain\username -farmservicepassword password -defaultindexlocation “C:\Program Files\Microsoft Office Servers\12.0\Data\Applications”

This starts your Office Search Services.

**CreateSSP**
stsadm -o extendvs -url http://%computername%:8100 -ownerlogin domain\username -owneremail email@yourdomain.com -exclusivelyusentlm -apidname “OurSSPon8100″ -apcreatenew -apidtype configurableid -apidlogin domain\username -apidpwd password

stsadm -o extendvs -url http://%computername%:8200 -ownerlogin domain\username -owneremail email@yourdomain.com -exclusivelyusentlm -apidname “MySiteson8200″ -apcreatenew -apidtype configurableid -apidlogin domain\username -apidpwd password

stsadm -o createssp -title “Shared Service Provider” -url http://%computername%::8100 -mysiteurl http://%computername%:8200 -indexserver %COMPUTERNAME% -indexlocation “%Programfiles%\Microsoft Office Servers\12.0\Data\Applications” -ssplogin domain\username -ssppassword password

**CreateSiteCollection**
stsadm -o extendvs -url http://%computername%:80 -ownerlogin domain\username -owneremail email@yourdomain.com -exclusivelyusentlm -apidname “SiteCollectionon80″ -sitetemplate SPSPortal -apidtype configurableid -apidlogin domain\username -apidpwd password

This will setup your webapps for shared services, my sites, create shared service provider and create your site collection as well.

That’s it.

Your MOSS installation is now completely scripted on SQL EXPRESS Edition.

Next series will be on unattended SQL Server 2005 installation and then a modified version of this script.

Scripted Installation for all site templates

Installing fab 40 using a script, is one of the most popular posts here. However, this installation guide covered wsp only and not stp. So here is the scripted installation guide for site template files.

Copy all stp files in a folder – like – C:\SharePointTemplates. Create a batch file in the same folder. Type in this command

for %%f in (*.stp) do stsadm.exe -o addtemplate -filename %%f -title %%f

Save the batch file and run it!

You can download the script from my skydrive.

SharePoint: Config XML and PSConfig

If you change the display option in config.xml as follows, then the setup file will install MOSS but will not run the SharePoint Configuration Wizard a.k.a psconfig.

<Display Level=”Basic” CompletionNotice=”no” />

There are a lot of advantages to not running SharePoint Configuration Wizard. As I was finalizing this post, I read on Chandima’s blog, which echo the concerns I have had, of using SharePoint Configuration Wizard (SPC from here on :-) )

Earlier I have written on how psconfig can be used for configuring WSS installation. Same applies to MOSS. You get complete control. With SharePoint 2007 iterations, stsadm is not the only powerful command line tool available. Psconfig is another great cli tool.

In this post, I will share with you the psconfig commands, that you can run and your MOSS will be configured with your desired options.

psconfig.exe -cmd configdb -create

psconfig.exe -cmd helpcollections

psconfig.exe -cmd secureresources

psconfig.exe -cmd services -installall

psconfig.exe -cmd services -provision

psconfig.exe -cmd installfeatures

psconfig.exe -cmd adminvs -provision -port 8080  (this will install central administration on port 8080)

psconfig.exe -cmd evalprovision ( run this only if it is a single server installation – that is what we are doing MOSS on SQL Server Express Edition )

psconfig.exe -cmd applicationcontent install

That’s it. This is nothing new, it has been blogged before and my sharing it with you is part of the series on MOSS Scripted Installation. More so, it validates what I have done and it has been echoed time and again.

I have been using to test our deployment, since last 3 months now. Our deployment is going to be very interesting – 1000+ MOSS Sites – all with their own database, etc :-)

I will be using this very technique, so it’s straight from the field.

With this script, your MOSS scripted setup is complete. What you get is Central Admin, SSP, MySite, SiteCollection. This is possible using evalprovision cmd.

Remember, you get to configure only the Central Admin Port.

Want to configure ports for SSP and have host header for site collection? Hmm.. stay tuned. ;-)

This is seventh in the series – MOSS Scripted Installation.

How to enable SQL Browser Service using a script

This is sixth in the series – MOSS Scripted Installation.

Up until this post we have covered

The last one was a manual step. In this post, let’s see how we can script this.

Configuring SQL Area Configuration to allow remote connections

In my situation I configured SAC and exported the configuration, because I am going to be deploying nearly 1300 sites and it’s gotta be scripted.

I would like to make an assumption here that if you have a SQL Server 2005 Express Edition, you will be able to use the xml that I am going to share with you.

How to export SQL Area Configuration?

Browse to C:\Program Files\Microsoft SQL Server\90\Shared

From command prompt, run this command

“C:\Program Files\Microsoft SQL Server\90\Shared\SAC.exe out sac.xml”

This will export surface area settings for all database engine and SQL Browse service instances. Since I have not specified the location of sac file, it will export to C:\

Out command is for export and

In command is for import

For more options, you can use the standard ? for help with SAC.

So that’s sorted.

Enabling SQL Browser Service

By defauly, SQL Browser service is disabled when you install SQL Server 2005 Express Edition.

To enable, you could do this from the services mmc, but lets run a script that will enable SQL Browser Service to auto and also start immediately.

sc config sqlbrowser start= auto

net start sqlbrowser

That’s it!

Next up in the series, variation of config.xml to setup MOSS 2007 and not run the configuration wizard!

Howto configure sql express to allow remote connections

This is fifth in the series – MOSS Scripted Installation.

In previous posts, I wrote about pre-requisites and a brief overview on config.xml. Next we saw, how MOSS 2007 could be installed silently with SQL Server 2005 Express Edition.

It was a small step. This post is about allowing remote connections to SQL Server 2005 Express Edition. If you ever need to move sql database, attach pre-configured database or detach existing database, you will need to enable remote connections in sql server 205 express edition. It is disabled by default.

You can do this using SQL Server Area Configuration.

Configuring SQL Server Area Configuration for remote connections

To do this, follow these steps:

1.Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.

2.On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.

3.On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.
Note Click OK when you receive the following message:

Changes to Connection Settings will not take effect until you restart the Database Engine service.

4.On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.

Enabling SQL Browser Service

Additionally, you need to enable the SQL Browser Service to make remote connections.

Warning These steps may increase your security risk. These steps may also make your computer or your network more vulnerable to attack by malicious users or by malicious software such as viruses.

1.Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.

2.On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.

3.On the Surface Area Configuration for Services and Connections page, click SQL Server Browser, click Automatic for Startup type, and then click Apply.
Note When you click the Automatic option, the SQL Server Browser service starts automatically every time that you start Microsoft Windows.

4.Click Start, and then click OK.

These are manual steps. If you want to script both these steps, watch out for the next post.

Related KB

Script to install MOSS with SQL Express

This is fourth in the series – MOSS Scripted Installation.

In previous posts, I wrote about pre-requisites and a brief overview on config.xml.

Now let’s get down to real business.

All installation files will be in C:\Build\Packages\MOSS

  1. Create C:\Build\Packages\MOSS folder structure
  2. Copy Microsoft SharePoint Server 2007 installation files in C:\Build\Packages\MOSS\Server12
  3. Copy SQL Server files to C:\Build\Packages\MOSS\SQLExpress
  4. Create C:\Build\Packages\MOSS\Scripts
  5. Copy Config.xml from C:\Build\Packages\MOSS\Server12\Files\SetupSilent\ to C:\Build\Packages\MOSS\Server12\
  6. Edit this config.xml and replace with your MOSS product key. Leave the rest as is.

Launch the setup (assumption is made that you have already installed .net3 framework)

C:\Build\Packages\MOSS\Server12\setup.exe /config “C:\Build\Packages\MOSS\Server12\config.xml”

Go and have a coffee or tea whilst the setup completes. Just launch the task manager to see when psconfig.exe finishes it’s job :-)

You are all done!

Next – Configuring SQL Express Edition to allow remote connections.

SharePoint config.xml

This is third in the series – MOSS Scripted Installation.

Before we proceed with the installation, let’s understand the core file to configure for unattended (scripted) installations.

That file is the config.xml .

This installation is in single server mode (basic).

Understanding config.xml

SharePoint Server 2007 includes different Config.xml files for different types of configurations. Each Config.xml file is located in the following folder of the SharePoint Server 2007 installation source, depending on the edition of SharePoint Server 2007 that you have:

•x86\Files\SetupFolderName

•x64\Files\SetupFolderName

The biggest difference between Windows SharePoint Services and Microsoft Office SharePoint Server 2007 config.xml is the package id.

Have a peek inside WSS config.xml and then in MOSS config.xml.

You will notice this difference as under

WSS SetupSilent config.xml

<Configuration>
<Package Id=”sts”>
<Setting Id=”REBOOT” Value=”ReallySuppress”/>
<Setting Id=”SETUPTYPE” Value=”CLEAN_INSTALL”/>
</Package>

<Logging Type=”verbose” Path=”%temp%” Template=”Microsoft Windows SharePoint Services 3.0 Setup(*).log”/>
<Setting Id=”SERVERROLE” Value=”SINGLESERVER”/>
<Setting Id=”UsingUIInstallMode” Value=”0″/>
<Display Level=”none” CompletionNotice=”no” />
</Configuration>

MOSS SetupSilent config.xml

<Configuration>
<Package Id=”sts”>
<Setting Id=”LAUNCHEDFROMSETUPSTS” Value=”Yes”/>
<Setting Id=”REBOOT” Value=”ReallySuppress”/>
<Setting Id=”SETUPTYPE” Value=”CLEAN_INSTALL”/>
</Package>

<Package Id=”spswfe”>
<Setting Id=”SETUPCALLED” Value=”1″/>
<Setting Id=”REBOOT” Value=”ReallySuppress”/>
<Setting Id=”OFFICESERVERPREMIUM” Value=”1″ />
</Package>

<Logging Type=”verbose” Path=”%temp%” Template=”Office Server Setup(*).log”/>
<Display Level=”none” CompletionNotice=”no” />
<PIDKEY Value=”Enter PID Key Here” />
<Setting Id=”SERVERROLE” Value=”SINGLESERVER”/>
<Setting Id=”USINGUIINSTALLMODE” Value=”0″/>
</Configuration>

Since we have not made any changes to the MOSS config.xml, it will also run the SharePoint Configuration Wizard, since

<Display Level=”none” CompletionNotice=”no” />

If you change this to basic, SharePoint Configuration Wizard won’t run.

If you change this to full, it’s as good as you installing this manually :-) , so keep it to none.

Next in line – script to install MOSS with SQL Express.