Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 178257

Can't set network adapter state

$
0
0

I have written a basic script to connect a virtual machines network status to both Connected & Connect at power on. The script appears to run fine without any errors. However when i check a system the network box is still unchecked. Here is the script:

 

 

#Script to connect a virtual machines network card
$cred = Get-Credential
Connect-VIServer server.domain.com -Credential $cred
$machines = Get-VM 
foreach ($machine in $machines)
{
Set-NetworkAdapter -NetworkAdapter 'Network adapter 1' -Networkname 'Organisation LAN' -StartConnected:$true -Connected:$true
}
Disconnect-VIServer -Confirm:$false


Viewing all articles
Browse latest Browse all 178257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>