Domain Join Via Cmd
Here username and password should be of a the domain specified in domain switch.
Domain join via cmd. There are two ways to join or leave a domain. The nt resource kit supplement 2 ships a new utility called netdom exe which can be used to not only join domains but create computer account and trust relationships. To join a domain there are 2 paths the first is to just add the computer to the domain and create the computer account simultaneously which is ok if you are logged on as a domain administrator if you are not a domain.
Add computer domainname domain lan credential account user domain domainname. On the computer to join the domain open a powershell command prompt and enter the following command. The user should have privileges to join a computer to the domain.
Netdom exe join computername domain domainname userd domainname username passwordd password. When you join a domain by using the command line utility ad bridge enterprise uses the hostname of the computer to derive a fully qualified domain name fqdn and then automatically sets the fqdn in the etc hosts file. The netdom command or the powershell command lets add computer and remove computer.