From Joel Oleson’s Blog (http://blogs.msdn.com/joelo/)
Configuring Service Principle Names (SPNs)
The first thing you need to do in order to enable Kerberos for SharePoint is configure Service Principle Names (SPNs) for your SharePoint service accounts in Active Directory. Here lies the first stumbling block… depending on your configuration it is very hard to figure out which SPNs need to be applied to which accounts.
If you are installing SharePoint properly, you’ll use the ‘least privilege account principle’; this basically means that each distinct service inside the SharePoint farm will have its own domain user account. These accounts should have the minimum privileges that they need to perform their jobs. There is a great document which goes into detail on each different account (8+ accounts) here, however in summary, you should have the following accounts:
-
SQL Server Service Account: Account used by SQL to run all SQL services
-
Server Farm Account
-
SSP Service Account
-
Office SharePoint Server Search Account
-
Default Content Access Account
-
User Profile and Properties Content Access Account
-
Excel Services Unattended Account
-
One account per application pool: This is typically three accounts; SSPAdministration, MySite and your main ‘Portal’ or ‘Intranet’.
SPNs are used by Kerberos to ensure that only certain accounts have permission to delegate a specific service on a user’s behalf. An SPN needs to be configured for each service and address that the account needs to delegate for. SPNs are configured by using SetSPN.exe (download here) which is a command line provided as part of the Windows 2003 resource kit. This table outlines the commands that are required to create the right SPNs for each of the relevant SharePoint service accounts, however please bear the following points in mind:
-
Some services require the fully qualified domain name (FQDN) even if your users only use the host name. For example if user type http://portal to get to you main portal and you Active Directory is called Domain.local then the FQDN is Portal.Domain.Local
-
Some SPNs require the host name which is the FQDN without the .domain.local bit on the end. In the example above, this would simply be portal
-
For all user accounts you must include the domain prefix.
-
To make the table easier to understand, I have included an example for a single server farm in a domain called ‘Domain.local’ where the MOSS server is called ‘Server’ and I have three host headers for web applications which are called ‘My Site’, ‘Portal’ and ‘SSPAdmin’. The ‘least privilege account principle’ has been used in this example and the accounts are fairly descriptively named.
| Command |
Notes
|
| Setspn.exe -A HTTP/%SHAREPOINTSERVERFQDN% %SERVERFARMACCOUNT% |
%SHAREPOINTSERVERFQDN% = the FQDN of your SharePoint server’s NetBIOS name (local machine name) %SERVERFARMACCOUNT% = Server Farm Account
Example: Setspn.exe -A HTTP/server.domain.local domain\serverfarm
|
| Setspn.exe -A HTTP/%MYSITEURLFQDN% %MYSITEAPPPOOLACCOUNT% |
%MYSITEURLFQDN% = the FQDN of the host header for the My Site Web Application
%MYSITEAPPPOOLACCOUNT% = The application pool account that the My Site web application uses
Example: Setspn.exe -A HTTP/mysite.domain.local domain\mysiteapppool or Setspn.exe -A HTTP/server.domain.local domain\mysiteapppool
|
| Setspn.exe -A HTTP/%MYSITEURLHOST% %MYSITEAPPPOOLACCOUNT% |
%MYSITEURLHOST% = the host name (i.e. without the .domain.local bit) for the My Site web application
%MYSITEAPPPOOLACCOUNT% = The application pool account that the My Site web application uses
Example: Setspn.exe -A HTTP/mysite domain\mysiteapppool or Setspn.exe -A HTTP/server domain\mysiteapppool
|
| Setspn.exe -A HTTP/%PORTALURLFQDN% %PORTALAPPPOOLACCOUNT% |
%PORTALURLFQDN% = the FQDN of the host header for the main portal or intranet Web Application
%MYSITEAPPPOOLACCOUNT% = The application pool account that the Portal web application uses
Example: Setspn.exe -A HTTP/portal.domain.local domain\portalapppool
|
| Setspn.exe -A HTTP/%PORTALURLHOST% %PORTALAPPPOOLACCOUNT% |
% PORTALURLHOST % = the host name (i.e. without the .domain.local bit) for the Portal web application
%MYSITEAPPPOOLACCOUNT% = The application pool account that the Portal web application uses
Example: Setspn.exe -A HTTP/portal domain\portalapppool
|
| Setspn.exe -A HTTP/%SSPADMINURLFQDN% %SSPADMINAPPPOOLACCOUNT% |
% SSPADMINURLFQDN % = the FQDN of the host header for the SSP Administration Web Application
% SSPADMINAPPPOOLACCOUNT % = The application pool account that the SSP Administration web application uses
Example: Setspn.exe -A HTTP/sspadmin.domain.local domain\sspadminapppool
|
| Setspn.exe -A HTTP/%SSPADMINURLHOST% %SSPADMINAPPPOOLACCOUNT% |
% SSPADMINURLHOST % = the host name (i.e. without the .domain.local bit) for the SSP Administration web application
% SSPADMINAPPPOOLACCOUNT % = The application pool account that the SSP Administration web application uses
Example: Setspn.exe -A HTTP/sspadmin domain\sspadminapppool
|
Trust for Delegation
In addition to setting the SPNs for each of your service accounts, you also need to trust each of the computer accounts and some of the service accounts for delegation. Trusting for delegation means that the accounts are allowed to delegate on a user’s behalf.
In order to trust for delegation you need to open Active Directory Users and Computers as a user with domain administration rights and follow these instructions
-
Repeat the process for each of the following
-
MOSS Server (Computer Account)
-
SQL Server (Computer Account)
-
FarmService (User Account)
-
MySiteAppPool (User Account)
-
SSPAdminAppPool (User Account)
-
PortalAppPool (User Account)
-
Locate the account and click ‘properties’
-
Navigate to the ‘Delegation’ tab
-
Choose ‘Trust this user/computer for delegation to any service (Kerberos)’
Enable Kerberos on your web applications
In MOSS 2007, the switch between Kerberos and NTLM is very simple and is undertaken via Central Administration.
If you are creating your farm from scratch, be sure to set Central Administration itself to use Kerberos which you can set as part of the ‘SharePoint Products and Technologies Configuration Wizard’, however if the farm is pre-created you can easily enable Kerberos by following these steps:
-
Open Central Administration
-
Navigation to Application Management > Authentication Providers
-
Choose the web application you wish to configure from the drop-down in the top right corner (this includes the Central Administration web application)
-
Click on ‘Default’
-
Set the authentication to Negotiate (Kerberos)
-
IISRESET
Enable Kerberos on your SSP
In this step you enable Kerberos on your SSP. Follow these steps:
-
Open a Command Prompt and navigate to your ‘12\Bin’ directory (normally c:\program files\common files\microsoft shared\web server extensions\12\bin)
-
Run ‘STSADM.exe -o SetSharedWebServiceAuthn -negotiate’
Component Services Configuration
This is one of the lesser documented steps. You need to set various permissions in Component Services. Follow these steps:
-
Open Component Services on the MOSS server
-
Navigation to Component Services > Computers > My Computer
-
Click on Properties (for My Computer) > Default Properties > Default Impersonation Level = Delegate (see http://support.microsoft.com/kb/917409)
-
Navigate to Component Services > Computers > My Computer > DCOM Config > IIS WAMREG Admin Service
-
Click on Properties (for IIS WAMREG Admin Service) and navigate to the Security tab
-
Edit Launch and Activate Permissions
-
Grant all three of your application pool account ‘Local Activation’ permissions (see http://support.microsoft.com/kb/920783). In our example, these accounts would be domain\MySiteAppPool, domain\SSPAdminAppPool, domain\PortalAppPool
Testing Kerberos Configuration
The thing with Kerberos is that it can be difficult to see if it is working properly. There are several things you can do to check:
-
Do your web applications work from a client computer? If they do, then this is a good sign
-
Keep an eye on your System event log on both your MOSS and SQL servers. Kerberos related errors are logged here.
-
Make sure all the servers in the loop (MOSS, SQL and Domain Controllers) have the same time set. Inconsistent time settings are one of the primary causes of Kerberos related issues.
Configure Kerberos for MOSS
The first step in configuring this scenario is to get your base MOSS configuration sorted. Follow the steps in my first article to do this
Configure Permissions in SQL AS
This section specifically relates to using SQL Analysis Services, but similar steps will be required for normal SQL or Reporting Services.
In order that users can access your SQL AS cube, you need to configure permissions inside SQL Management Studio. Follow these steps:
-
Open SQL Management Studio
-
Connect to Analysis Services
-
Right-click on the server level and go to properties
-
Go to the Security tab
-
Give the relevant users access. If you want everyone to have access, add ‘authenticated users’
This will means that user have access to actually read the data from the AS cube
Configure Excel Services for Delegation
One of the key things that people get caught out with on when attempting this scenario is configuring Excel Services to use Delegation (i.e. to use Kerberos rather than NTLM). This is a setting that you can only set by using STSADM.exe; you cannot set it through the SharePoint Administration pages and it is not well documented. The discussion thread outlines this step: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1224539&SiteID=17
Follow these steps:
-
On your SharePoint server, open a command prompt and navigate to c:\program files\common files\microsoft shared\web server extensions\12\bin
-
Run the following command where %SSPNAME% is the name of your Shared Service Provider:
-
stsadm.exe -o set-ecssecurity -ssp %SSPNAME% -accessmodel delegation
-
Now run the following command:
-
stsadm.exe -o execadmsvcjobs
-
Now perform and IISRESET
Create your Data Connection file
Now Excel Services has been configured, you need to make sure that the data connection has the right settings for Kerberos. Typically in this scenario, a data connection file will be created and stored in a SharePoint data connections library. This ensures that you only have to set the data connection up once and use it many times.
There are several key settings that must be in the data connection file in order for Kerberos to work, these include using the FQDN of the SQL server and adding SSPI=Kerberos to the connection string. Follow these steps:
-
Open Excel 2007 (Client)
-
Go to the ‘Data’ ribbon
-
In the ‘Get external data’ area click on ‘From Other Sources’ and choose ‘From Analysis Services’
-
Enter the FQDN of your SQL server here (i.e. server.domain.local, not just server), leave the default of ‘Use Windows Authentication’ and click Next
-
Choose the database and cube that you wish to connect to and click Next. Click Finish on the following screen.
-
Choose to show a pivot table (this is not relevant and will not be used at this stage) and click OK
-
Once the pivot table is displayed, it is a good idea to test it out to make sure you got the right settings
-
Go to the ‘Data’ ribbon and click ‘Properties’
-
Go to the ‘Definition’ tab of the connection properties dialog
-
Add ‘;SSPI=Kerberos’ (without the ‘) at the end of the connection string (after MDX Missing Member Mode=Error)
-
Now Export your data connection to SharePoint by clicking ‘Export Connection File’
-
Enter the full URL to the Data connection library that you wish to save you data connection to and click ‘Save’.
-
You may now close Excel and disregard the spreadsheet (you have got the data connection in SharePoint which is the bit you need)
Configure your site
Now you have created the data connection, you can go ahead and configure your site.
Generally one of the first things to do is to add an ‘SQL Server 2005 Analysis Services Filter’ webpart which uses the data connection to provide filters to other webparts on your site. This is one of the first places to test Kerberos. When you add the SQL AS Webpart, you will first need to choose the data connection. Upon doing this the Dimension drop-down should populate with dimensions from SQL. If this works then Kerberos is working!