As I wrote earlier today I am provisioning Virtual Machines with PowerCLI. I don’t know if this is intentional behaviour but after Deploying (Cloning) a Virtual Machine from a template the Network Adapter is not automatically connected at power on.

This made the Join Domain operation which is party of the Customization Specification to fail. I noticed this in the log file which can be found in %WINDIR%\Temp\vmware-imc\guestcust.log:

Joining domain mydomain using account mydomain\myaccount and password '*****' The specified domain either does not exist or could not be contacted.
So I wrote a small fix script in PowerCLI:
powershell Download
ForEach ($VM in Get-VM)
{
	ForEach ($NetworkAdapter in $VM.NetworkAdapters)
	{
		Write-Host "Set-NetworkAdapter -NetworkAdapter $NetworkAdapter -StartConnected $true" -ForegroundColor Blue
		Set-NetworkAdapter -NetworkAdapter $NetworkAdapter -StartConnected $true -Confirm:$false
	}
}

And of course I changed the Provisioning script to do this as well :D