Issue Creating SQL Login for AppPoolIdentity on Windows Server 2008
- by Ben Griswold
IIS7 introduced the option to run your application pool as AppPoolIdentity. With the release of IIS7.5, AppPoolIdentity was promoted to the default option. You see this change if you’re running Windows 7 or Windows Server 2008 R2.
On my Windows 7 machine, I’m able to define my Application Pool Identity and then create an associated database login via the SQL Server Management Studio interface. No problem. However, I ran into some troubles when recently installing my web application onto a Windows Server 2008 R2 64-bit machine. Strange, but the same approach failed as SSMS couldn’t find the AppPoolIdentity user. Instead of using the tools, I created and executed the login via script and it worked fine.
Here’s the script, based off of the DefaultAppPool identity, if the same happens to you:
CREATE LOGIN [IIS APPPOOL\DefaultAppPool] FROM WINDOWS WITH DEFAULT_DATABASE=[master] USE [Chinook] CREATE USER [IIS APPPOOL\DefaultAppPool] FOR LOGIN [IIS APPPOOL\DefaultAppPool]