kwhelp
asked on
How to retain IP settings when using POWERCLI to change NIC adapter type.
Hi,
I have a script to shutdown selected VMs, change the NIC adapter type to VMXNET3 and then power back on. Problem is, the new NIC doesn't retain the IP settings. Script below. Any idea how I can dump out the IP config first and import it back in at the end? thanks.
$a = Get-Content "e:\vmps\serverlist.txt"
foreach ($i in $a)
{update-tools $i
Shutdown-VMGuest -VM $i -Confirm:$false
start-sleep -seconds 25
get-vm $i|get-networkadapter|set- networkada pter -type VMXNET3 -Confirm:$false
start-VM -VM $i}
I have a script to shutdown selected VMs, change the NIC adapter type to VMXNET3 and then power back on. Problem is, the new NIC doesn't retain the IP settings. Script below. Any idea how I can dump out the IP config first and import it back in at the end? thanks.
$a = Get-Content "e:\vmps\serverlist.txt"
foreach ($i in $a)
{update-tools $i
Shutdown-VMGuest -VM $i -Confirm:$false
start-sleep -seconds 25
get-vm $i|get-networkadapter|set-
start-VM -VM $i}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.