Have you thought of splitting your script into two pieces?

1) setup a run task and auto logon as domain admin account
2) run NETDOM with /REBoot


Computer reboots and is noW a member of domain

3) auto logon as domain admin (since "Domain Admins group is now in local administrators)
4) finish other tasks
_________________________
Home page: http://www.kixhelp.com/hb/