SQL Server JDBC 接続が「ユーザーのログインに失敗しました」というエラーで失敗する。Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } データベースが Windows Integrated Authentication を必要としているにもかかわらず、MID Server サービスが正しいドメインアカウントを使用するように構成されていない場合に発生する SQL Server JDBC 接続エラーを解決します。 JDBC データソースを使用して Microsoft SQL Server データベースからデータを取得する際、データソースレコードに正しい資格情報が含まれていても、「Login failed for user」エラーで接続が失敗する場合があります。 Symptoms<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } MID サーバーログに次のエラーが表示されます。 java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'DOMAIN\username'. ClientConnectionId:76194d006-988f-4814-aec1-366o28bfb62c Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } サポートされているすべてリリース 影響を受けるインテグレーション Service Graph Connector for SCCMSCCM 2016 integration(非推奨)JDBC 経由で Microsoft SQL Server に接続する任意の統合 (Integration) Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } SQL Server データベースは Windows 統合認証 (Integrated Authentication) を必要とします。これが有効になっている場合、データベースはデータソースレコードで指定されたユーザー名とパスワードではなく、MID Server サービスを実行している Windows アカウントの資格情報を使用します。 MID Server サービスが SQL Server データベースへのアクセス権を持つドメインアカウントとして実行されていない場合、データソースの資格情報が正しくても接続は失敗します。 Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } MID Server サービスを構成 MID Server ホストで、Windows Services を開きます。ServiceNow MID Server サービスを見つけます。サービスを右クリックして Properties を選択します。Log On タブを選択します。This account を選択し、ドメインアカウントの資格情報を入力します(例:DOMAIN\svc-account)。パスワードを入力します。OK を選択します。サービスを再起動します。 データソースを構成 ServiceNow で、System Import Sets > Administration > Data Sources に移動します。データソースレコードを開きます。Use integrated authentication (統合認証を使用) を true に設定します。Save を選択します。 JDBC 接続文字列を更新する(必要な場合) 接続が依然として失敗する場合は、JDBC 接続文字列に integratedSecurity パラメータを追加します。 jdbc:sqlserver://database-server.example.com:1433;selectMethod=cursor;databaseName=exampledb;integratedSecurity=true 追加の考慮事項 異なるサービスアカウントを必要とする複数の統合 MID Server Windows サービスは、単一のユーザーアカウントとしてのみ実行できます。異なるユーザーアカウントで Integrated Authentication を必要とする複数の SQL Server 接続がある場合は、各アカウントに対して個別の MID Server を使用する必要があります。統合認証を必要としない統合の場合、サービスアカウントに関係なく同じ MID Server を使用できます。 「Login is from an untrusted domain」エラー 統合認証を使用する場合、次のエラーが表示されることがあります。 java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. このエラーは通常、既存の MID Server がオンプレミスにある場合に、AWS EC2 インスタンスなど、異なるネットワークロケーションで新しい MID Server をセットアップする際に発生します。これは Active Directory 信頼の問題です。 Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } MID Server system requirements Create a JDBC type data source Service Graph Connector for Microsoft SCCM