PowerCLI

 View Only
  • 1.  network adapter - connected and connect at power on

    Posted Sep 25, 2010 12:57 PM

    Hi

    I have 10 to 20 vms, they are not connected to network, when i checked the status for device the adapter was unchecked for

    connected & connect at power on, how could i enable ( make a check mark) on them using the script ? they are on dhcp.

    Thank you.



  • 2.  RE: network adapter - connected and connect at power on
    Best Answer

    Posted Sep 25, 2010 02:34 PM

    Try this

    Get-VM | Get-NetworkAdapter | Set-NetworkAdapter -StartConnected:$true -Connected:$true
    

    See the Set-NetworkAdapter cmdlet for more info.

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 3.  RE: network adapter - connected and connect at power on

    Posted Sep 25, 2010 05:32 PM

    Thanks - it works, i had a do a small change to filter the vmk network. .....:)

    Get-VM | Get-NetworkAdapter | Where { $_.NetworkName -eq "VM Network" } |

    Set-NetworkAdapter -StartConnected:$true -Connected:$true



  • 4.  RE: network adapter - connected and connect at power on

    Posted Sep 28, 2010 02:31 AM

    is it possible to add 2nd NIC (adapter type: vmxnet3) and remove 1st NIC or uncheck the connected/connect at power on?



  • 5.  RE: network adapter - connected and connect at power on

    Posted Sep 28, 2010 07:58 AM

    That should be possible.

    Have a look at the New-NetworkAdapter cmdlet. With the -Type parameter you can select a vmxnet3 card.

    You can remove the first NIC with the Remove-NetworkAdapter cmdlet. But I would advise to do this when the guest is powered off.

    The alternative is to change the StartConnected option with the Set-NetworkAdapter cmdlet.

    ____________

    Blog: LucD notes

    Twitter: lucd22