VMware Cloud Community
Thushyaaa
Contributor
Contributor
Jump to solution

network adapter - connected and connect at power on

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.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Thushyaaa
Contributor
Contributor
Jump to solution

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

0 Kudos
sdspin
Contributor
Contributor
Jump to solution

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

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos