I wrote a script that automates using netdom to join or disjoin a domain and I thought others might find it useful as well.
I've tested this with XP and Windows 7 (32 and 64 bit) and it works fine for us. It should work fine with Vista. You will need to do several things before you can use this:
First, you'll need to set the global parameters appropriately.
Secondly, you'll need to acquire netdom and set it up on the appropriate paths in your ltshare\transfer folder (see the paths in the script and match them). For the windows 7 netdom, download RSAT (you only need the x86 version's netdom - it works on x64 computers) here: http://www.microsoft.com/downloads/deta ... laylang=en
After it installs, run this to get netdom:
start /w pkgmgr /iu:RemoteServerAdministrationTools-Roles-AD-DS-SnapIns;RemoteServerAdministrationTools-Roles-AD-DS;RemoteServerAdministrationTools-Roles-AD;RemoteServerAdministrationTools-Roles;RemoteServerAdministrationTools
Then copy netdom.exe from system32 **AND** "netdom.exe.mui from the "en-US" folder.
For XP, get the XP Support Tools for SP2 (the latest version MS has) to get the XP copy of netdom. You don't need the "mui" for XP.
I would provide a zip file with the netdom versions, but I don't know what the board policy is regarding posting Microsoft files/etc. If a Labtech forum admin says that it's okay then I'll post that zip file as well and save people the trouble. Please don't ask for me to directly send you the files since they are publically available, though, thanks.
The join and disjoin scripts both create or update a local admin user account. We do this as a safety precaution on workstations we manage so we always have a fallback account to access, but you can remove that section if you don't want to do that.