M
Magnus R
In VB.Net I'm trying to find out the names of what Administrative Groups
exist by querying Active Directory. The problem is when I try and query the
children of the key LDAP://CN=Administrative Groups, CN=ExchOrg,
CN=Microsoft Exchange, CN=Services, CN=Configuration, CN=domain, CN=com I
don't get anything except an error that the "Object doesn't exist on the
server." However when I bind to this LDAP path using LDP.exe I can see the
Administrative Group Names underneath the tree just fine and even drill in
to them.
Here's my code:
Dim TempDE As New DirectoryEntry("LDAP://CN=Administrative Groups,
CN=ExchOrg, CN=Microsoft Exchange, CN=Services, CN=Configuration, CN=domain,
CN=com")
Dim prop As DirectoryEntry
Dim propnm As String = String.Empty
Dim strv As String
Dim objv As Object
MessageBox.Show(TempDE.Name.ToString)
For Each prop In TempDE.Children
For Each strv In prop.Properties.PropertyNames
For Each objv In prop.Properties(strv)
propnm += strv & " : " & objv.ToString & vbCrLf
Next
Next
Next
If I change the LDAP path to LDAP://CN=Microsoft Exchange, CN=Services,
CN=Configuration, CN=domain, CN=com the code above works fine.
exist by querying Active Directory. The problem is when I try and query the
children of the key LDAP://CN=Administrative Groups, CN=ExchOrg,
CN=Microsoft Exchange, CN=Services, CN=Configuration, CN=domain, CN=com I
don't get anything except an error that the "Object doesn't exist on the
server." However when I bind to this LDAP path using LDP.exe I can see the
Administrative Group Names underneath the tree just fine and even drill in
to them.
Here's my code:
Dim TempDE As New DirectoryEntry("LDAP://CN=Administrative Groups,
CN=ExchOrg, CN=Microsoft Exchange, CN=Services, CN=Configuration, CN=domain,
CN=com")
Dim prop As DirectoryEntry
Dim propnm As String = String.Empty
Dim strv As String
Dim objv As Object
MessageBox.Show(TempDE.Name.ToString)
For Each prop In TempDE.Children
For Each strv In prop.Properties.PropertyNames
For Each objv In prop.Properties(strv)
propnm += strv & " : " & objv.ToString & vbCrLf
Next
Next
Next
If I change the LDAP path to LDAP://CN=Microsoft Exchange, CN=Services,
CN=Configuration, CN=domain, CN=com the code above works fine.