To join a domain using powershell, use the following command:
Add-Computer -ComputerName mycomputername -DomainName mydomain -Credential mydomain\Administrator