How to get Windows domains in Java

I have a Windows computer. I need Windows domains to be available for this PC to log in. Any ideas?

+3
source share
4 answers

This only works if it USERDOMAINis defined as an environment variable. I read at http://www.wilsonmar.com/1envvars.htm that %USERDOMAIN%this is the username.

If %USERDOMAIN%is the username, use this:

String UserDomainName = System.getenv("USERDOMAIN");
+4
source

As suggested by the answer to this question , ActiveDirectoryis an LDAP server. Here's an article on how to use it with Java .

+2
source

This is a Windows-only feature, so you may have to use JNA to access the Windows system functions, and then find the right function for that.

0
source

Use WAFFLE. It supports "Active Directory Domain Enumeration and Domain Information."

0
source

All Articles