How can I log in to a Mac using an Active Directory account?
dsconfigad -preferred ads01.example.com -a COMPUTERNAME 
–domain example.com -u administrator -p "password"

For more information just check the manual (Integrating Active Directory)