script to join a computer to a domain

Hello, im wanting a script to join a computer to a domain. I have a lot of machines that have been sysprep'd and i would like a way to automate joining a domian.

I know its possible within the sysprep.inf file but its not secure because sysprep.inf is not securly deleted (can be retrieved along with the passwords). From the documentation i read, it says this is possible throught WMI but im not too sure on how to do this and whether this would be the best method. Any help or advice welcome?

Usage: cscript.exe NetDomOU.vbs Join|Unjoin|Remove /Domain:domain [/OU:ou] [/User:user] [/Password:password]
Join: Joins the computer to a domain.
Unjoin: Unjoin the computer from a domain. No other arguments required. The domain computer account will not be deleted!
Remove: Unjoin the computer from a domain and delete the domain computer account. No other arguments required. Administrative permissions on the domain are required! (The /user-argument is ignored). Wait for replication to finish before rejoining the computer!
/Domain: Name of the domain.
/User: The usersaccount used to execute the command, using the domain\username or username@domain notation! Leave username and password empty to use callers credentials.
/OU: The full 'distinguished name' of the organisational unit where the new domain computer account will be created when joining a domain. Example /OU:"OU=myOU, DC=domain, DC=com". The name must be between quotes! Leave empty to add the computer to the default 'Computers'-container.
/Reboot: Reboot the computer if Join/Unjoin/Remove whas succesfull.

Featured Post

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help.
This command will place all the files that have not been used rec…

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …

The viewer will learn how to create a basic form using some HTML5 and PHP for later processing.
Set up your basic HTML file. Open your form tag and set the method and action attributes.:
(CODE)
Set up your first few inputs one for the name and …