Implementing Kerberos for SharePoint running on Windows Server 2008 and IIS7

Before I start writing how to set up Kerberos authentication in SharePoint, let me explain our set up a little bit, i.e. server names, account names and so on that will be used in this guide:

WSSSERVER1 – SharePoint web front server

WSSSERVER2 – another web front server (optional)

DBSERVER1 – database server running Microsoft SQL Server 2005 SP2

Domain\wss_srvc_account – User account used to run SharePoint services

Domain\sql_srvc_account – User account used to run SQL services on database server

Domain\wss_apppool – User account used to run SharePoint web application pool

Domain\mysite_apppool – User account used to run My Site web application pool

Domain\sspadmin_apppool – User account used to run Shared Services Provider web application pool

 

To set up a Kerberos authentication in SharePoint (WSS or MOSS) you need to do a bunch of small configuration changes:

  1. Make sure that you have host headers set up for your SharePoint sites. For example, in case of Windows SharePoint Services you will have only the main SharePoint website, whereas in case of Microsoft Office SharePoint Server 2007 you will have main SharePoint website, My Site website, and Shared Services Provider Sites. For the sake of simplicity, let's call those host headers: http://sharepoint, http://mysite, http://sspadmin respectively.
  2. Update Alternate Access Mappings to point websites to website host headers. In other words, replace http://servername:2222 entry with http://sharepoint

     

  3. Add SPN records for:
    1. Hostnames and FQDN of computer account(s) of your SharePoint server(s), for example
      Setspn.exe -A HTTP/WSSSERVER1 DOMAIN\wss_ srvc_account
      Setspn.exe -A HTTP/WSSSERVER1.domain.local DOMAIN\wss_srvc_account
      Setspn.exe -A HTTP/WSSSERVER2 DOMAIN\wss_ srvc_account
      Setspn.exe -A HTTP/WSSSERVER2.domain.local DOMAIN\wss_srvc_account
    2. Hostnames and FQDN of computer account of your SQL server, for example
      Setspn.exe -A MSSQLSvc /DBSERVER1:1433 DOMAIN\sql_srvc_account
      Setspn.exe -A MSSQLSvc /DBSERVER1.domain.local:1433 DOMAIN\ sql_srvc_account
    3. Host headers for your SharePoint websites, for example
      Setspn.exe -A HTTP/INTRANET DOMAIN\wss_apppool
      Setspn.exe -A HTTP/ INTRANET. domain.local DOMAIN\wss_apppool
      Setspn.exe -A HTTP/MYSITE DOMAIN\mysite_apppool
      (Do not apply in case of WSS)
      Setspn.exe -A HTTP/MYSITE. domain.local DOMAIN\mysite_apppool
      (Do not apply in case of WSS)
      Setspn.exe -A HTTP/SSPADMIN DOMAIN\sspadmin_apppool
      (Do not apply in case of WSS)
      Setspn.exe -A HTTP/SSPADMIN. domain.local DOMAIN\sspadmin_apppool
      (Do not apply in case of WSS)

       

    1. Configure "Trust for Delegation" on all computer accounts and user accounts used in SharePoint configuration. To configure "Trust for delegation":
      1. Open Active Directory Users and Computers management console
      2. Right click on a user or computer account that require ""Trust for Delegation" configured and click on Properties
      3. Where you find this option in the GUI depends on the Active Directory functional level. In case of Windows 2000 domain, the option is under Account tab for user accounts and General tab for computer accounts. In case of Windows 2003 domain, the option is under a separate Delegation tab. Note: Delegation tab is only visible for accounts that have SPNs registered

         

  4. Configure Component Services to allow Local Launch and Activation permissions for IIS WAMREG Admin Service for all application pool accounts used in SharePoint configuration. To configure Component Services setting go Control Panel >> Component Services >> Computers >> My Computer >> DCOM Config >> properties of the "IIS WAMReg Admin Service" >> Security tab >> edit "Launch and Activate Permissions" >> add "Local Launch" and "Local Activation" permissions for all the application pool accounts

     

  5. Because in IIS7 HTTP.sys is handling the authentication, it is by default done under the LocalSystem account regardless of the application pool account you're using. However, because even a single SharePoint server configuration is now considered a web farm, we should use a domain account to run SharePoint application pools. As a result we need to modify applicationhost.config file to configure the useAppPoolCredentials attribute in system.webServer/security/authentication/Windows-Authentication configuration section to true.

    <windowsAuthentication enabled="true" useKernelMode="true" useAppPoolCredentials="true"/>

     

     

  6. Once you have made a change to applicationhost.config file you might start getting errors 6398, 7076, 6482 in your Event Viewer. To get rid of those errors you need to apply hotfix KB946517. This hotfix is currently is available for Windows Server 2003, XP and Vista and it is under development for Windows Server 2008. I have used Vista version of the hotfix on Windows Server 2008 and it seems to have worked fine (knocking on wood...)

     

  7. Now you're ready to switch your SharePoint web applications to Kerberos authentication. Open SharePoint Central Administration >> Application Management >> Authentication Providers >> choose your web application >> change authentication to Negotiate (Kerberos)

     

     

  8. In case of MOSS, to change your Shared Services Provider web application to use Kerberos authentication run the command: stsadm.exe -o SetSharedWebServiceAuthn –negotiate. Stsadm.exe is usually placed under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\bin.

 

 

That's it, you should now have your web applications using more secure Kerberos authentication. You can use Fiddler (http://www.fiddlertool.com/Fiddler2/version.asp) to verify that your web application is in fact using Kerberos authentication. Here are a few links that will help you might find useful:



Related resources:

How to get Exchange 2007 running on a virtual server

It's been a while since I blogged about something. Maybe it's because I've been busy lately, maybe it's because of I've spent a week at the TechEd conference (the best conference ever, by the way) and a week working on my tan at Daytona Beach, or maybe it's because I'm just getting old and lazy. But I digress...

I have recently had the "pleasure" of installing Microsoft Exchange 2007 SP1 on a virtual server running Windows Server 2008. I was eager to try Microsoft's latest and greatest product. Originally I wanted to install it on Microsoft Virtual Server, but unfortunately MS Virtual Server doesn't support 64-bit virtual servers on a 32-bit host server! So, to get virtual server running, I had to rebuild the physical server, which makes no sense to me whatsoever. Since I was willing to do that, I had no choice but to go with VMWare Virtual Server which fully supports 64-bit virtual servers on a 32-bit host server. VMWare's product turned out to be an excellent product with tons of easy to use features. Hopefully, Microsoft's product will soon catch up.

Usually, I would never recommend running Exchange 2007 virtually in the production environment, unless you have a kick-a$$ host server to run it or if you have fewer than 50 mailboxes. But if you have to - or want to - run Exchange 2007 on VMWare Virtual Server, you need to know that Microsoft does not support this scenario. Even though for the most part it runs fine, there is a problem with the way VMWare virtual adapters work with IP6, which causes the problem with Outlook Anywhere connectivity.

Fortunately, there is a great article on Microsoft Exchange Team blog that helps you to deal with that problem: http://msexchangeteam.com/archive/2008/06/20/449053.aspx . Essentially, you need to turn off IP6 on your Exchange server NIC configuration and in the hosts.conf file. You also need to make sure that your Exchange server can talk to Global Catalogue servers by configuring RPCProxy port in the registry.

There is also a great online tool from Microsoft that helps you troubleshoot any connectivity issues with Exchange 2007/2003: https://www.testexchangeconnectivity.com/

In conclusion, kudos to VMWare for the great product, and kudos to Microsoft for their detailed documentation to get things working, as well as providing great online tools for troubleshooting.

Going virtual with your domain controllers

If you plan to convert your physical domain controllers into virtual servers, you probably know there is a lot to consider prior to the move. But what you might not know is that Active Directory doesn't like being restored from the image, which what all physical-to-virtual conversion tools (Acronis, Ghost, etc.) are doing. It doesn't matter if you are trying to convert your physical server to a virtual or if you're converting your server from one virtual format to another (for example, Vmware-to-VPC, or vice versa).

After the conversion, replication process breaks and the error starts appearing in the log files "The source server is currently rejecting replication requests"; the same error pops up when you try to run dcpromo command. Obviously if the problem is not resolved within 60 days, that domain controller will get tombstoned by Active Directory, which is not very good. Most of the websites suggest to forcibly remove that domain controller from the Active Directory by running dcpromo / forceremoval and then cleaning up your schema using metadatacleanup of ntdsutil. To me this solution is not only too drastic, but often is not an option because it might cause more problems than it will resolve.

After an extensive research I have finally found a solution that has worked for me. The solution is actually pretty simple: you simply need to enable inbound and outbound replication on the "faulty" domain controller.

To enable inbound replication, run:

repadmin /options SERVERNAME -disable_inbound_repl

To enable outbound replication, run:

repadmin /options SERVERNAME -disable_outbound_repl

 

And the error disappears J

Enable Detailed Error Messages in MOSS 2007 and WSS3.0

To get more detailed messages in MOSS 2007 and WSS3.0 during development process, user can enable debugging in the web.config file for the SharePoint web application:

<SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">

And:

<customErrors mode="Off" />

This should make development process so much pleasant and more efficient, by getting rid of "An unexpected error has occurred" error, which is useless to the developers.

Note: It's not recommended to have debugging enabled on the production server, if possible, please do all your debugging on the development server(s)

Piping STSADM command

I recently discovered that piping can be used in conjunction with STSADM command. I always found it difficult to use that command. It has too many options and parameters that are not always obvious and often very difficult to use. Piping makes it easier to use STSADM command, it can be used for search through STSADM keywords in the commands: For example, stsadm | find "enum" can be used to find all STSADM keywords related to enumeration within SharePoint. Or, you can also use pipe | more to paginate the STSADM output, which could be very useful.

You can also redirect STSADM output using the redirecting command: stsadm > filename >& This can be very helpful when you need to generate an output and view it later, or if you need to export that output into a different application.

I realize it's very basic, but it's the basic things like this that help me save time and keep my sanity.

Attaching old Content Database to new Web Application in MOSS 2007 or WSS 3.0

If you have recently re-attached your content database to the new web application in SharePoint 2007 (whether because you have moved your SharePoint install or simply because you had to re-create the web application on your current server), you might have noticed a new error (Event ID: 5555; Event Source: Office SharePoint Server) occurring hourly in the Event Log of your web-front SharePoint server.

The description of the error tells you to run stsadm – o preparetomove, which doesn't seem to fix the problem, unfortunately. This command only prevents the error 5555, if you run it before moving and re-attaching your content databases. To fix error 5555, you need to run stsadm –o sync instead.

In my case, running the following command made error 5555 disappear:

stsadm -o sync -DeleteOldDatabases 0

As usual: ALWAYS BACKUP YOUR SHAREPOINT BEFORE MAKING ANY CHANGES TO ITS CONFIGURATION

One Year Anniversary

Today was my one year anniversary in my new job as an IT Manager at ObjectSharp. It's been an interesting year; a year full of new experiences and surprises, mostly good ones.

One year ago I have traded a job at a public sector for one in a private sector. I have traded a stable and secure environment with clear guidelines, managerial or supervision rules and specific working times for a more open managerial style, openness to new ideas and more flexibility in rules with fewer guidelines. And, honestly, I have no regrets so far. After a year, I'm having more fun than ever. It's fascinating working with a team of exceptional people from a range of disciplines whose commitment to excellence is steadfast. At ObjectSharp, I got a chance to work with the newest and coolest technologies from Microsoft (often even before those technologies were available to the general public.) Here, I am working with a talented team of professionals who not only know how to get those technologies to work, but they know how to make them work better and more efficient. I love it!

On sad note, today I was expecting balloons, hugs, high fives, or even just a disgusted "I can't believe your still here". Nothing. Well, there is still time... ;)

Note: Later that day I did get a few high fives, no balloons though J

   

   

   

  

Getting around the limitation on a number of controls on SharePoint page

Apparently there is a limit on a number of controls you can have on a SharePoint page. By default, no more than 200 controls are allowed on the SharePoint page. Not sure, why this limitation is there, but it is. To get around this problem, you need to increase the MaxControls setting in your web.config file:

<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">

<PageParserPaths>

</PageParserPaths>

</SafeMode>

In my case, I have MaxControls parameter set to 300.

Team System Web Access 2008 SP1 CTP and Work Item Web Access 2008 CTP are now available

Team System Web Access 2008 SP1 CTP (Community Technology Preview) and Work Item Web Access 2008 CTP are now available for download. Even though it's only CTP version at the moment, don't let it discourage from using it, because it seems to be working very well. By the way, you still have to have Team Explorer 2008 installed to use TWSA and/or WIWA, which is not a big deal since it's free and most of us already have it installed anyway. For those who don't have Team Explorer 2008 installed, it can be downloaded for free from http://www.microsoft.com/Downloads/details.aspx?familyid=0ED12659-3D41-4420-BBB0-A46E51BFCA86&displaylang=en.

Team System Web Access 2008 SP1 has some really great features:

  • Single instance with multiple languages (9 languages are available: ENU, CHS, CHT, DEU, ESN, FRA, ITA, JPN, KOR)
  • Support for specifying field values in the URL for creating new work items (works in both TSWA and WIWA)
  • Share ad-hoc work item queries
  • Shelveset viewer
  • Improved search support

Team System Work Item Web Access 2008 CTP allows users to use some work item tracking feature without having TFS client access license (CAL.) A user without TFS CAL can use WIWA to:

  • Create new work items
  • Edit the work item you have created
  • See the list of work items you have created

However, user cannot:

  • See work items created by others
  • List, view, edit or run work item queries
  • Add, edit or remove work item links (except attachments and hyperlinks)
  • Access documents stored on the project portal
  • Access project reports
  • Access source control
  • Access team build

Specs for WIWA can be found at http://msdn2.microsoft.com/en-us/teamsystem/bb936702.aspx

SharePoint public-facing website and Microsoft Office documents

When you have a public-facing site built using SharePoint technologies, opening Microsoft Office documents (Word, Excel, PowerPoint, Visio, etc.) stored on this website requires user to login. You can hit Cancel at the login prompt and still be able to see the document, but having a login prompt displayed to the Internet users, sort of defeats the purpose of having SharePoint-built public facing website with anonymous access turned on. This happens becuase Microsoft Office is closely integrated with MOSS or WSS 3.0 now, and MS Office is now able to recognize that the document is stored within SharePoint, so the appropriate SharePoint authentication/authorization tools kick in. This problem can be resolved mostly by implementing two simple steps (assuming you have already enabled anonymous access on SharePoint):

  1. Disable 'Client Integration' for the web application under Central Admin Home Page >> Application Management >> Authentication Providers
  2. Remove the OPTIONS verb from the <HTTPHandlers> registration line in web.config file


Related resources: