dsconfigad can be used to bind to Active Directory from the command line. Use as follows:
dsconfigad -h
dsconfigad -show [-lu username] [-lp password]
dsconfigad [-f] [-a computerid] -domain fqdn -u username [-p password]
[-lu username] [-lp password] [-ou dn] [-status]
dsconfigad -r -u username [-p password] [-lu username] [-lp password]
dsconfigad [-lu username] [-lp password] [-mobile enable | disable]
[-mobileconfirm enable | disable]
[-localhome enable | disable] [-useuncpath enable | disable]
[-protocol afp | smb] [-shell value] [-uid attribute | -nouid]
[-gid attribute | -nogid] [-ggid attribute | -noggid]
[-preferred server | -nopreferred]
[-groups “group1,group2,…” | -nogroups] [-alldomains enable | disable]
[-packetsign allow | disable | require]
[-packetencrypt allow | disable | require]
[-passinterval value] [-namespace forest | domain]
[-enableSSO]
dsconfigad -staticmap attribute-type attribute-value [-lu username]
[-lp password]