Using the following command, a computer can be joined to an existing Active Directory Domain.
netdom join %computername% /domaind:DOMAIN /userd:username /passwordd:password
PowerShell it can be accomplished with the following.
add-computer -domainname domainname -credential domainname\username -restart