サービス プリンシパル名の構成の状態

Microsoft.SQLServer.2008.DBEngine.Configuration.SPNStatusMonitor (UnitMonitor)

このモニターは、Microsoft® SQL Server™ インスタンスのサービス プリンシパル名の構成の状態を確認します。

Knowledge Base article:

概要

このモニターは、Microsoft® SQL Server™ インスタンスのサービス プリンシパル名の構成を確認します。これは、SQL Server サービスとドメイン コントローラーの構成を比較することで行われます。

原因

SQL Server データベース エンジンのサービス プリンシパル名 (SPN) が見つからないか、間違っているか、ドメインの Active Directory で構成されている他の SPN と重複している可能性があります。

注: 間違っている SPN は、Active Directory の間違ったアカウントで構成された SPN です。

解決方法

setspn.exe および klist.exe プログラムを使用して問題を解決できることがあります。

どちらのツールも Windows Server 2008 以降に付属しています。以前のバージョンの Windows では、Microsoft ダウンロード センターから別途ダウンロードするか、Windows サポート ツール パッケージから取得する必要があります。

ケース 1: 不足している SPN を解決する方法

1.次のコマンドを実行して不足している SPN を追加します。

setspn –A <SPN> <アカウント>

2.クライアント アプリケーションを使用して SQL Server に再接続を試みます。

または、SQL サービス アカウントに適切な権限を与え、SQL が必要な SPN を自動的に生成できるようにします。

注: SPN が不足していても接続エラーが発生しないことがありますが、アプリケーションで Kerberos 認証を使用できません。

ケース 2: 間違っている SPN を解決する方法

1.次のコマンドを実行して間違っている SPN を削除します。

setspn –D <SPN> <アカウント>

2.クライアント コンピューターで、ログオフして再度ログインするか、次のコマンドを実行して、Kerberos チケットのキャッシュを消去します。

klist purge

3.Try reconnecting to SQL Server with your client application.

注: アプリケーションから Kerberos を使用するには、前のケース 1 の解決策を使用して正しい SPN を構成する必要があります。

ケース 3: 重複している SPN を解決する方法

1.重複していて削除する必要がある SPN を特定します。

2.次のコマンドを実行して、重複している各 SPN を削除します。

setspn –D <SPN> <Account>

3.On the client machine, either logoff and log back in or clear the Kerberos ticket cache by running the following command:

klist purge

4.Try reconnecting to SQL Server with your client application.

外部資料

SPN の構成が間違っている場合、SQL Server への接続の問題が発生することがあります

Element properties:

TargetMicrosoft.SQLServer.2008.DBEngine
Parent MonitorSystem.Health.ConfigurationState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.2008.DBEngine.Configuration.SPNStatus
RemotableTrue
AccessibilityPublic
Alert Message
サービス プリンシパル名 (SPN) が不足しているか、間違っているか、重複しているため、SQL Server は Kerberos を使用して認証できません。


SQL Server cannot authenticate using Kerberos because the Service Principal Name (SPN) is missing, misplaced, or duplicated.
サービス アカウント: {0}
不足している SPN: {1}
間違っている SPN: {2}
重複する SPN: {3}
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2008.DBEngine.Configuration.SPNStatusMonitor" Accessibility="Public" Enabled="true" Target="SQL2008Core!Microsoft.SQLServer.2008.DBEngine" ParentMonitorID="SystemHealth!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2008.DBEngine.Configuration.SPNStatus" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2008.DBEngine.Configuration.SPNStatusMonitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/Account$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='MissingSpnList']$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='MisplacedSpnList']$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='DuplicateSpnList']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Good" MonitorTypeStateID="Good" HealthState="Success"/>
<OperationalState ID="Bad" MonitorTypeStateID="Bad" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ComputerNetworkName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerNetworkName>
<NetbiosComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</InstanceName>
<Account>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/Account$</Account>
<ServiceName>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$</ServiceName>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>