Hey there,
I'm running the following script on a group of VMs within a vApp in an attempt to get them to join my domain:
$vms = Get-VM -Location vAppname $vmUser = "Administrator" $vmPass = "password" foreach ($vm in $vms){ $cmd = "wmic.exe /interactive:off ComputerSystem Where ""Name='%computername%'"" call JoinDomainOrWorkgroup AccountOU=""OU-Computers`;DC=mydomain';DC=net"" FJoinOptions=1 NAme="mydomain.net"" Password=""password"" Username=""user@mydomain.net"" Invoke-VMScript -VM $vm -ScriptType bat -ScriptText $cmd -GuestUser $vmUser -GuestPassword $vmPAss }
This script runs through the VMs and I get "Method execution successful" each time. The problem is that the script doesn't appear to do anything. Even after reboot, all of the machines are still using local accounts on WORKGROUP.
Any advice would be greatly appreciated!