Quantcast
Viewing all articles
Browse latest Browse all 240675

Re: {get-view $_.Id} command

Here is the script I use  

 

     $vh01=$hostname6                                                                             
    $vh01moref=$vh01 | % {get-view $_.Id}
   
    $vh01morefconfig=$vh01moref.configmanager                                                                               
    $vh01netsys=$vh01morefconfig.networksystem
    $vh01netsysmoref=get-view $vh01netsys

    foreach ($vh01vsw0 in $vh01netsysmoref.NetworkConfig.Vswitch){   
        $swspec= $vh01vsw0.Spec
        $swspec.policy.security.allowPromiscuous=$false
        $swspec.policy.security.forgedTransmits=$true
        $swspec.policy.security.macChanges=$false
        $vh01netsysmoref.UpdateVirtualSwitch($vh01vsw0.name,$swspec)
    }


Viewing all articles
Browse latest Browse all 240675

Trending Articles