Using only the javax.naming API, is there some metadata or other trick I can use to determine if I am in fact connected to an Active Directory server or some other type of directory server ?
相关问题
- Active Directory on-prem Manager
- PrincipalContext LDAPS Self-Signed Certificate
- System.DirectoryServices vs system.directoryservic
- Get all attributes from Active Directory using Spr
- Filter ldapsearch with awk/bash
相关文章
- getting user details from AD is slow
- Can't get deleted items from OpenLDAP Server u
- Is it possible to send LDAP “requests” via telnet?
- GetNamedSecurityInfo returns ERROR_ACCESS_DENIED(5
- GWT JDBC LDAP connection fails
- Getting the user's Full Name from Active Direc
- Set Access to dropdownlist items based on the User
- dsmod or other command to edit AD user attributes
The root DSE may contain attributes that contain information about the directory server's software. However, the root DSE and/or the attributes may not be present or attributes may not be named the same in all directory server implementations. Nevertheless, you can query the DSE and see what it offers for the directory software your app will support. Here's an LDAP search to get the root DSE:
This assumes that the DSE is associated with an objectclass. The vendor may have a proprietary method for providing the same.
There is this informational RFC 3045; it talks about storing vendor related information in the root DSE. Two attributes that may be populated by the directory server software are
vendorname
andvendorversion
. You can check the existence of these in the root DSE returned by the server(s) you're working with.Here's a crude Java code to pull those two attributes from the root DSE (using the LDAP provider, that is):