特定のユーザーのユーザーグループを取得しようとしているときにASP.NET4アプリケーションが失敗するという問題を見つけるのに問題があります。このアプリケーションに関連付けられているアプリケーションプールは、ApplicationPoolIdentityで実行するように設定されています。
例外情報
System.DirectoryServices.DirectoryServicesCOMException
HRESULT: 80072020
Message: An operations error occurred.
Extended Message: 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1
スタックトレース
System.DirectoryServices.DirectoryEntry.Bind(Boolean)
System.DirectoryServices.DirectoryEntry.Bind()
System.DirectoryServices.DirectoryEntry.get_AdsObject()
System.DirectoryServices.DirectorySearcher.FindAll(Boolean)
System.DirectoryServices.DirectorySearcher.FindOne()
95%〜99%の確率で、この関数は正常に機能しますが、ときどき失敗し始めます。LocalSystemまたはNetworkServiceを使用するようにアプリケーションプールを変更すると、動作を開始します。ApplicationPoolIdentityに戻すと、再び失敗し始めます。ApplicationPoolIdentityを使用してサイトを再び機能させる唯一の方法は、サーバーを再起動することです。
ここでも同様の問題を見つけることができましたが、解決策は再起動でもありました。アプリケーションプールのIDを変更する以外に、より永続的な解決策を見つけたいと思います。