Vsphere Powercli
Jump to navigation
Jump to search
re-register ips with dhcp
$Datacenter = "" $vCenter = "" Connect-VIServer $vCenter $vmlist = Get-Cluster "" | Get-VM # | Select @{N="IP Address";E={@($_.guest.IPAddress[0])}} $sleep = sleep 10 $GetCred = Get-Credential foreach ($vm in $vmlist) { $vmName = Get-VM $vm $script0 = "Register-DNSClient" Invoke-VMScript $script0 -vm $vmName -GuestCredential $GetCred #Invoke-Command -ComputerName $vm -Credential $GetCred -ScriptBlock { Register-DnsClient } #sleep 10 }