This script can be used to join a Windows instance to an existing Active Directory domain. Simply execute the script with .\join_domain.ps1
and follow the prompts. Afterwards you will be given the option to reboot the instance to finalize the domain join.