私はLDAPの初心者です。すべてのNTドメイン名を一覧表示しようとしています。NTドメイン名とは、LANネットワーク上にあるドメインの名前です。Windows XPマシンでそのマシンにログオンしようとすると、これを確認できます(つまり、ctrl + alt + delを押した後に表示されるログオンダイアログ)。通常、資格情報を入力した後、最後のドロップダウンでドメイン名を選択します。
私はこの投稿を見てみましたが、何もできませんでした。何なのかわかりませんrootDSE
。投稿で与えられたコードはrootdseでそれを行います。ただし、ヒットしてクエリを実行する特定のサーバーがあり、そのサーバーはドメインコントローラーだと思います。(私はこれについて間違っているかもしれません)。私たちは次のようなものを書きます
LDAP://<domain_name>/dc=<domain>,dc=org
投稿で与えられているように、私はという名前のプロパティを探しようとしましたrootDomainNamingContext
。しかし、私はそれを見つけることができませんでした。次に、以下のコードを試しました。
Sub Main()
Dim oRoot As DirectoryEntry = Nothing
'Dim oSearcher As DirectorySearcher
'Dim oResults As SearchResultCollection
Try
oRoot = New DirectoryEntry("LDAP://<domain_name>/dc=<domain>,dc=org")
For Each obj As String In oRoot.Properties.PropertyNames
Console.Write(obj + ", ")
Next
Catch ex As Exception
Console.Write(ex.Message)
Finally
oRoot.Dispose()
End Try
Console.Read()
End Sub
得られた出力で具体的に何を探すべきかわかりません。私が得た出力は次のとおりです。
objectClass, description, distinguishedName, instanceType, whenCreated, whenChan
ged, subRefs, uSNCreated, dSASignature, repsTo, repsFrom, uSNChanged, name, obje
ctGUID, replUpToDateVector, creationTime, forceLogoff, lockoutDuration, lockOutO
bservationWindow, lockoutThreshold, maxPwdAge, minPwdAge, minPwdLength, modified
CountAtLastProm, nextRid, pwdProperties, pwdHistoryLength, objectSid, uASCompat,
modifiedCount, auditingPolicy, nTMixedDomain, rIDManagerReference, fSMORoleOwne
r, systemFlags, wellKnownObjects, objectCategory, isCriticalSystemObject, gPLink
, gPOptions, masteredBy, ms-DS-MachineAccountQuota, msDS-Behavior-Version, msDS-
PerUserTrustQuota, msDS-AllUsersTrustQuota, msDS-PerUserTrustTombstonesQuota, ms
Ds-masteredBy, dc, nTSecurityDescriptor,
ここで本当にガイダンスが必要です。
アップデート
以下のコードを使用してドメインを取得しました。
Dim dc As New DirectoryContext(DirectoryContextType.DirectoryServer, DcIpAddr)
Dim domc As DomainController = DomainController.GetDomainController(dc)
For Each dmn As Domain In domc.Forest.Domains
Console.WriteLine(dmn.Name)
Next
現在、問題は2つあります。まず、ドメイン名の不一致。私のDCのDNS名がprod.domain.com
であり、予想されるドメイン名がたとえばであるとしdev, domain, etc
ます。代わりに私は得るdev.domain.org, domain.org, etc
。Windowsログインダイアログに表示される名前の一部は、照会されると、接尾辞domain.org
;が付いて表示されます。接尾辞が付いているものもあります.org
。
2番目の問題は、すべてのドメイン名(Windowsのログインダイアログに表示される3番目のドロップダウン)が表示されないことです。なぜそうなのかしら?
アップデート
他のドメイン(表示されていない)が別のドメインコントローラーサーバーの一部である可能性があるか、適切な資格情報を使用してDCにアクセスする必要があることを確認してください。