I recently had a requirement to use a scripted approach to create a SharePoint farm that used Kerberos authentication.
A quick bit of research pointed me towards the excellent resources made available by Gary Lapointe (see his blog at http://stsadm.blogspot.com/).
Gary has created and made freely available a huge number of really useful custom STSADM commands and Powershell commandlets, as well as going through the code used to create them. It really is an excellent resource he has created, and well worth spending some time going over all the information that he has very generously compiled and offered there.
One of the items Gary has on the site is his Install scripts (http://stsadm.blogspot.com/2008/03/sample-install-script.html) which creates a Kerberos based
MOSS farm, including creating and configuring the SSP and search, a portal web application, a mysites web application and a team sites web application.
This is all achieved with batch files that cal PSCONFIG and STSADM commands, with a few of his own custom STSADM commands being used – very helpfully, these commands are provided as a WSP which is installed as a part of the farm creation scripts. Very neat.
These scripts follow Microsoft's "Plan for Administrative and Service Accounts (Office SharePoint Server): Least-Privilege Admin Requirements when using Domain Accounts" (http://technet.microsoft.com/en-us/library/cc263445.aspx ).
I thought I would quickly go through the steps I followed to build my development vm using these scripts (note: these aren’t a comprehensive set of steps, for example I don’t indicate when I performed Windows updates and took vm snapshot’s etc., but rather cover the main items that must be completed in order to successfully create a Kerberos authenticated farm).
In order to enable Kerberos, many accounts used during the install process require Service Principal Name’s (SPN’s), and being entrusted to delegate authority. To make these changes, you require access to the ADSI Edit MMC snap-in. Instructions on how to install this if it is not available on the machine can be found at http://technet.microsoft.com/en-us/library/cc773354(WS.10).aspx
To Create an SPN
1. Log on to your Active Directory domain controller using the credentials of a user that has domain administrative permissions.
2. In the Run dialog box, type ADSIEDIT.MSC.
3. In the management console dialog box, expand the domain container folder.
4. Expand the container folder containing user accounts, for example CN=Users.
5. Locate the container for the SQL Server Service account, for example CN=mosssqlsvc.
6. Right-click this account, and then click Properties.
7. Scroll down the list of properties in the SQL Server Service account dialog box until you find servicePrincipalName.
8. Select the servicePrincipalName property and click Edit.
9. In the Value to Add field, in the Multi-Valued String Editor dialog box,enter the Service Principal Name string – which takes the form of: {Protocol}/{host and FQDN}:{Port}, e.g. “MSSQLSvc/mosssql:1433” or “HTTP/intranet.development.com” * – and click Add.
10. Click OK on the Multi-Valued String Editor dialog box, and then click OK on the properties dialog box for the SQL Server service account.
*One little “gotcha” that you may need to be aware of when creating a Kerberos authenticated farm is that SharePoint 2007 only supports Kerberos web applications running of the default ports. This is why I have not had to supply port numbers in the SPNs used by the application pool accounts.
Setting an Account as Entrusted to Delegate Authority
1. Start the “Active Directory Users and Computers” MMC snap-in.
2. In the left pane, click Users.
3. In the right pane, right-click the name of the user account, and then click Properties.
4. Click the Account tab, under Account Options, click to select the Account is trusted for delegation check box, and then click OK.
Ok, so to create my environment, the steps I followed were (note: these steps assume that the current account being used to perform the installation is a member of the local administrators group):
1. Create the vm, install the operating system and activate the Application Server, Domain Controller and DNS roles (I cover these steps in a bit more detail in this post: http://suguk.org/blogs/the_moss-pit/archive/2008/12/22/16362.aspx).
2. Create the SQL Server service account (svc-sqlsvr) as a domain account, give it an SPN of MSSQLSvc/{host and FQDN}:1433, and enable it for delegation.
3. Install SQL Server and all related SP’s.
4. Grant the current account performing the install sys_admin privileges on the database.
5. Create the following domain accounts, setting the one’s with SPN’s to be trusted for delegation (format: Account Name -- SPN -- Comments):
spadmin -- [none] -- Used to generate emails from the farm to users. Requires an email address to be specified like no-reply@{email}.{server}
spfarm -- HTTP/{host & FQDN}:{Admin port} -- [no comment]
sspapppool -- HTTP/sspadmin.{FQDN} -- Should not be a member of the Administrators group on any computer in the server farm.
sspsvc -- [none] -- This account should not be a member of the Administrators group on any computer in the server farm.
sspsearch -- [none] -- Should not be a member of the Farm Administrators group.
sspcontent -- [none] -- Should not be a member of the Farm Administrators group.
sspuserprofilesvc -- [none] -- Requires read access to the directory service, and Manage User Profiles personalization services permission.
sspexcelsvc -- [none] -- used for running excel services on the ssp
sphelpsearch -- [none] -- Should not be a member of the Farm Administrators group.
spcontentsearch -- [none] -- Should not be a member of the Farm Administrators group.
spportalapppool -- HTTP/portal.{FQDN} -- Should not be a member of the Administrators group on any computer in the server farm.
spmysitesapppool -- HTTP/mysites.{FQDN} -- Should not be a member of the Administrators group on any computer in the server farm.
spteamsiteapppool -- HTTP/teams.{FQDN} -- Should not be a member of the Administrators group on any computer in the server farm.
siteowner1 -- [none] -- Should be modified here and in the scripts to be a sensible account for your env.
6. Install MOSS, but don’t run the config wizard.
7. Install the MOSS infrastructure update (this is required to enable Kerberos), and the service packs.
8. Create your DNS entries to support the four web sites (sspadmin, portal, mysites, teams)
9. Run the Gary Lapointe’s farm creation scripts.
I then found a few more things I had to do to complete the farm install:
- configure the index server in central admin (Operations->Services on server->Search Indexing->Office SharePoint Server Search
- configure the default access account (SSP Admin->Search Administration->Default Content Access account)
Fix up the license type reset that happens when you install SP2 (CentralAdmin->Operations->Convert License Type)
- Go over the rest of the settings in the SSP and Central Admin to make sure they suit your needs (eg. crawl schedules and rules, profile import sched's, usage analytics etc.)
Following this process established the SharePoint farm which included the creating Central Admin, the SSP and three web applications.