C# で Active Directory サーバーにバインドしようとしていますが、オンサイトでテスト環境では再現できない問題があるようです。
例外が発生しています
System.Runtime.InteropServices.COMException (0x8007203A): The server is not operational.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.RefreshCache()
at System.DirectoryServices.DirectoryEntry.FillCache(String propertyName)
at System.DirectoryServices.DirectoryEntry.get_NativeGuid()
コードは次のようになります
// domainStr = "LDAP://domainname/rootDSE
using (var de = new DirectoryEntry(domainStr, Username, Password))
{
var guid = de.NativeGuid;
}
domainStr = "LDAP://domainController/rootDSE"
ただし、代わりに(または完全修飾された)ドメインコントローラーに接続しようとすると、問題なくdomainStr = "LDAP://domainController.DomainName"
動作します。
私は試した
var d = Domain.GetDomain(new DirectoryContext(
DirectoryContextType.Domain,
domainStr,
Username,
Password));
しかし、それを行うとまったく同じ例外が発生します。
何か間違ったことをしているのだろうか、別の LDAP URL の方がうまくいくのか、それとも私が抱えている一般的な問題なのか (Google 検索でその問題が発生しても、私にとって有効な解決策が見つかりませんでした) )
また、ソフトウェアが実行されているサーバーが Active Directory になく、接続先の AD のリストがあることを指摘する価値があるかもしれません (したがって、接続しようとするときのユーザー名とパスワード)