Joining windows VM to Active Directory

Problem:
Suggestions on how to automate the joining of a windows vm to an AD domain during provisioning. The method of provisioning the VM utilizes is outlined on the following site:
https://ramoni.com.br/2018/10/02/rlabs-provisioning-windows-with-foreman-on-vmware-from-template/

Foreman and Proxy versions:
1.19 (current as of November 9 2018)

Hello,

With the User_data script, In the sysprep commandList, you can launch and execute puppet that will verify if your VM is in the domain.