Ive used this guide before and it works well
http://blog.brianleejackson.com/sysprep-a-windows-7-machine-%E2%80%93-start-to-finish-v2I find this script works for auto joining to a domain
Const JOIN_DOMAIN = 1
Const ACCT_CREATE = 2
strDomain = "contoso.com"
strUser = "deployment"
strPassword = "K3UWtn4ru72j"
strOU = "OU=Deployment Project,DC=contoso,DC=com"
Set objNetwork = CreateObject("WScript.Netw
ork")
strComputer = objNetwork.ComputerName
Set objComputer = GetObject("winmgmts:{imper
sonationLe
vel=Impers
onate}!\\"
&
strComputer & "\root\cimv2:Win32_Compute
rSystem.Na
me='" & strComputer & "'")
objComputer.JoinDomainOrWo
rkGroup strDomain, strPassword, strDomain & "\" &
strUser, strOU, JOIN_DOMAIN + ACCT_CREATE
Invoke it on the first run after auto login