Hi,
I have been deploying VM from Template. After created VM, I am adding two network adapter which is relationship with different port group via PowerCLI.
Now , I want to rename these interfaces as LAN&BACKUP via Invoke-VMScript. Now , I've been searching all over for a way I could match network adapter inside windows to vmware's network adapter.
After , I will assign ip address to both these interface via Invoke-VMScript. How can I do that ?
LAN : ipaddress : 10.10.10.15 subnet : 255.255.255.0 gateway :10.10.10.1 DNS1 : 172.12.12.10 DNS2 : 172.12.12.11 METRIC :5
BACKUP : ipaddress : 192.168.120.15 subnet : 255.255.255.0 UNTICK Register this connection's address in DNS ,METRIC : 10
And route add xx.xx.xx.xx mask 255.255.255.0 xx.xx.xx.xx -p
script part :
LAN ->> New-NetworkAdapter -VM $vm -Type Vmxnet3 -NetworkName $_.NetworkName -WakeOnLan:$true -StartConnected:$true -Confirm:$false
if($_."Second Network Adapter" -eq "Y"){
$BackupNetworkName = "VLAN1000"
New-NetworkAdapter -VM $vm -Type Vmxnet3 -NetworkName $BackupNetworkName -WakeOnLan:$true -StartConnected:$true -Confirm:$false
}
else{
#do nothing
}