How do I unbind a Mac from the AD using the command line?

dsconfigad -remove -u DomainAdminsUserName -p Password

If that doesn't work, you may need to add -force.