$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
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.