File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Find domain for user from Active Directory Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "Find domain for user from Active Directory" Watch "Find domain for user from Active Directory" New topic
Author

Find domain for user from Active Directory

Bhanu Pandey
Greenhorn

Joined: Mar 08, 2010
Posts: 1
I wrote a java code to search for users from Active Directory server.
I got the user list but dont know the domain to which user belongs.
How can the domain of the user be found from Active Directory programatically.

One method thought of is :

1)Get the distinguished name of user from Active Directory.
2)Parse the distinguished name.
3)Get the substring that starts the first instance of "DC=".
4)Strip off the "DC=" at the beginning.
5)Replace all instances of ",DC=" with a "."
6)What is left is the DNS domain name of the user.

Is this reliable.
Please suggest some other solution.
 
 
subject: Find domain for user from Active Directory
 
Threads others viewed
Weblogic 10.3.5 & Windows 2003 Active Directory NO User but Groups
JNDI : Binding to an Active Directory Global Catalog with auser froma trusted Domain
ADS Import User List
JNDI, LDAP, & Active Directory
servlet querying active directory
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture