Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to fix Windows NT user or group 'IIS APPPOOL\DefaultAppPool' not found?

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?

like image 490
user603007 Avatar asked Jul 27 '12 01:07

user603007


People also ask

How do I make IIS AppPool DefaultAppPool?

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.

What user is ApplicationPoolIdentity?

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.

What is default app pool?

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.


3 Answers

This work for me

CREATE LOGIN [IIS APPPOOL\MyAppPool] FROM WINDOWS;
CREATE USER MyAppPoolUser FOR LOGIN [IIS APPPOOL\MyAppPool];
like image 105
sansalk Avatar answered Oct 06 '22 01:10

sansalk


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.

like image 31
DeanOC Avatar answered Oct 06 '22 01:10

DeanOC


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

like image 35
Russell Avatar answered Oct 06 '22 01:10

Russell