Assigning of Network adapter to VMs autometically through Powershell scripts

Dec 15, 2011 at 3:07 AM

Hi All

I need a help regarding creating a powershell scripts which will help me to assign Nic card to VM autometically.Let me describe the scenario below-

I Have two Hyperv hosts(OS-Win 2k8 R2 SP1) Host A and Host B.Host A and B are in Fail oVer cluster.Host A and B has four physical NIC each.Now out of four Nic card of Host A i have used NIC1 and NIC 2 to create two different Virtual Network switch(While configuring Virtual network) and same i have done with Host B also.

Now I Have put my all VMs thats are hosting on Host A in virtual network created by NIC1.Now suppose NIC1 goes down then all my VMs will be unreachable.So in case of that network faliure i want to assign the vitrual network which is created through NIC2 to all VMs of Host A autometically.So i just want to know that can it be done through powershell scripts.

If any one help me with this i will be greatful.