Saturday, March 5, 2016

VMware PowerCLI enable/disable vm network

$vmm=get-vm -name tech-jockey-vm1 |select name

foreach($vmn in $vmm)
{
#to disable the NIC
Get-VM -Name $vmn.name | Get-NetworkAdapter | Set-NetworkAdapter -Connected:$false -confirm:$false
}




# to enable NIC
#Get-VM -Name $vmn.name | Get-NetworkAdapter | Set-NetworkAdapter -Connected:$true -confirm:$false

No comments:

Post a Comment

Thanks for showing interest in tech-jockey.

Content of this blog has been moved to GITHUB

Looking at current trends and to make my content more reachable to people, I am moving all the content of my blog https://tech-jockey.blogsp...