This script will join a computer to a domain. You can either specify the parameters as command line arguments, or look them up in an ini file.
If an OU is not specified, the value is set to NULL, which means that the computer object will be placed in the OU/Container that is set as the Domain default within Active Directory, which is typically the Computers container.
It also checks to see if the computer object already exists in AD. If it does, it will join to the object in its existing location.
IMPORTANT: Refer to the %SystemRoot%\Debug\NetSetup.LOG file to help fault find any issues with the domain joining process.