2013-11-01 35 views
0

背景:無法將帳戶添加到SQL Server 2012中

我在IIS中有一個應用程序池[ABCDEMO]。 appool的身份是「NetworkService」。我想IIS APPPOOL \ ABCDEMO添加到我的SQL Server 2012在Windows Server 2012的

當我嘗試添加到登錄我碰到下面的錯誤。

=================================== 

Create failed for Login 'IIS APPPOOL\ABCDEMO'. (Microsoft.SqlServer.Smo) 

------------------------------ 
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Login&LinkId=20476 

------------------------------ 
Program Location: 

    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl() 
    at Microsoft.SqlServer.Management.SqlManagerUI.CreateLoginData.LoginPrototype.ApplyGeneralChanges(Server server) 
    at Microsoft.SqlServer.Management.SqlManagerUI.CreateLogin.DoPreProcessExecution(RunType runType, ExecutionMode& executionResult) 
    at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.DoPreProcessExecutionAndRunViews(RunType runType) 
    at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.ExecuteForSql(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult) 
    at Microsoft.SqlServer.Management.SqlMgmt.SqlMgmtTreeViewControl.Microsoft.SqlServer.Management.SqlMgmt.IExecutionAwareSqlControlCollection.PreProcessExecution(PreProcessExecutionInfo executionInfo, ExecutionMode& executionResult) 
    at Microsoft.SqlServer.Management.SqlMgmt.ViewSwitcherControlsManager.RunNow(RunType runType, Object sender) 

=================================== 

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) 

------------------------------ 
Program Location: 

    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType) 
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType) 
    at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries) 
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ExecuteNonQuery(StringCollection queries, Boolean includeDbContext) 
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImplFinish(StringCollection createQuery, ScriptingPreferences sp) 
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.CreateImpl() 

=================================== 

Windows NT user or group 'IIS APPPOOL\ABCDEMO' not found. Check the name again. (.Net SqlClient Data Provider) 

------------------------------ 
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.2100&EvtSrc=MSSQLServer&EvtID=15401&LinkId=20476 

------------------------------ 
Server Name: USALVWCOQA10 
Error Number: 15401 
Severity: 16 
State: 1 
Line Number: 1 


------------------------------ 
Program Location: 

    at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException) 
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType) 

任何幫助表示讚賞。

+0

爲什麼您需要添加此帳戶?它是爲了什麼? – Serg

+1

您不需要將應用程序池帳戶添加到SQL。如果有的話,您應該在IIS中擁有應用程序池標識的域級服務帳戶,然後在SQL中利用該帳戶。 –

+0

你真的有一個名爲「* IIS APPPOOL *」的域名嗎?我不認爲我曾經見過一個域名,裏面有空格。我懷疑SQL Server會對此感到滿意。 – RBarryYoung

回答

0

IIS框和SQL服務器在同一臺物理機器上嗎?

如果是這樣,你的應用程序池正在運行的網絡服務,您可以添加:

「NT AUTHORITY \ NETWORK SERVICE」

如果他們是在不同的機器上運行,則帳戶NETWORK服務使用認證到網絡的域帳戶服務器本身,在這種情況下,你應該讓機器帳戶的IIS服務器添加到SQL服務器的:

域\ IIS服務器$'

Obviousl y替換您的域名和IIS服務器的主機名稱,但美元符號很重要。

相關問題