Sql-server – Adding anonymous IURS IIS user fails into SQL SERVER 2008 R2

iisiis-7sql serversql-server-2008

I am trying to add a anonymous IIS user [IUSR] to a SQL SERVER 2008 r2 database.

But I am getting the following error:

'notebook/iusr' is not a valid login or you do not have permission.

I think permission is not the issue because I am logged with the 'sa' account.
Also I tried only 'iusr' as a username and I get the same error?

Does anyone have some idea on how to add the IIS7 anonymous account to a sql server 2208 r2 database?

Best Answer

This is called a managed service account (MSA).You have to add a dollar sign ($) after the username when creating the login. The format is DOMAIN\ACCOUNTNAME$. I believe you'll have to script this login out, as the GUI search feature won't find it.

CREATE LOGIN [DOMAIN\MACHINENAME$] FROM WINDOWS