There are many ways how to join a Windows machine to a domain. You can use for example command line or PowerShell script. I will show you how to do the same thing using a compiled EXE file written in C#.