In order for the Microsoft Deployment Toolkit (MDT)--or Microsoft System Center 2012 R2 Configuration Manager--to join machines to a domain, you need to create an account and configure permissions in Active Directory.

The Set-OUPermissions script creates a domain account and then configures OU permissions to allow the account to join machines to the domain in the specified organization unit (OU).

For more information on MDT 2013, and to download the free toolkit, see Microsoft Deployment Toolkit 2013.