when I run on sql server 2005:
EXEC sp_grantlogin "IIS APPPOOL\DefaultAppPool"
I get the error:
Msg 15401, Level 11, State 1, Procedure sp_grantlogin, Line 49
Windows NT user or group 'IIS APPPOOL\DefaultAppPool' not found. Check the name again.
How can I fix this?
Select a file or directory. Click the Locations button and make sure that you select your computer. Enter IIS AppPool\DefaultAppPool in the Enter the object names to select: text box. Click the Check Names button and click OK.
ApplicationPoolIdentity: When a new application pool is created, IIS creates a virtual account that has the name of the new application pool and that runs the application pool worker process under this account. This is also a least-privileged account.
One other option to consider...the DefaultAppPool creates its own user account and folder under the "c:\Users" directory when the pool is created and first run. Its actually a virtual user account and should be named for the Application Pool, or "DefaultAppPool". It uses this temporary user account to run the pool.
This work for me
CREATE LOGIN [IIS APPPOOL\MyAppPool] FROM WINDOWS;
CREATE USER MyAppPoolUser FOR LOGIN [IIS APPPOOL\MyAppPool];
You need to ensure that there is a Windows account called IIS APPPOOL\DefaultAppPool
on the machine. Run Computer Management on the machine,go to Local Users and Groups, and look at the properties in IIS_IUSRS
.
If there is no account there called IIS APPOOL\DefaultAppPool
then that is why you cannot add a login to SQL Server. You will only have this account on your SQL Server machine if you are also running IIS on that machine, as IIS APPPOOL\DefaultAppPool is a local account.
This link http://forums.iis.net/t/1174325.aspx seems to be very similar to your problem. There are some tips on how to solve the problem, including one at the very end which looks important.
For a lazy set up on my IIS 7.5 development box, I use BUILTIN\IIS_IUSRS
instead of the application pool identity IIS APPPOOL\DefaultAppPool
.
As the (dynamic) app pool identity users are always members of the Group IIS_IUSRS
, if you rename the app pool, or use a different app pool, it doesn't break the SQL permissions.
ref, Use BUILTIN\Group to Grant Access to Predefined Windows NT Groups: http://support.microsoft.com/kb/216808
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With