Search for terms "+join +domain" to get some hits.

You can also use the command line "netdom" tool to join or move computer accounts which might be the easier route - you can of course call netdom from within a script.