Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Windows Domains in Java

Tags:

java

windows

dns

I have some Windows PC's. I need to get the Windows domains available to this PC for logins. Any ideas?

like image 690
user489041 Avatar asked May 24 '11 13:05

user489041


People also ask

What are the domains in Java?

A domain class represents a table column and it allows you to handle the column value as a Java object. In the Doma framework, a domain means all the values which a data type may contain. In short, a domain class is a user defined class that can be map to a column.

What is a Windows network domain?

Windows network technology enables you to create network domains . A domain is a group of connected Windows computers that share user account information and a security policy. A domain controller manages the user account information for all domain members. The domain controller facilitates network administration.

Where is my windows domain 2019?

On your Windows PC, follow these steps to find your FQDN: Launch the Control Panel by searching for "Control Panel" in the Start Menu, or by typing Win+R and typing "control.exe" in the Run menu. On the System Information screen, you will see both the hostname and FQDN of your machine.


1 Answers

This only work if the USERDOMAIN is defined as an environment variable. I read in http://www.wilsonmar.com/1envvars.htm that %USERDOMAIN% is the User Domain Name.

If %USERDOMAIN% is the User Domain Name use this:

String UserDomainName = System.getenv("USERDOMAIN");
like image 67
moralejaSinCuentoNiProverbio Avatar answered Oct 01 '22 08:10

moralejaSinCuentoNiProverbio