I know this is an old post but I tried the code and the 2nd VM (AZDC-1) does not promote to the forest.
Is there any solution??