VMware Cloud Community
fredlock
Contributor
Contributor
Jump to solution

Howto list security settings of dvP´s

I use script below for listing security settings of the Distributed vSwitches

Get-View -ViewType VmwareDistributedVirtualSwitch -Property Name,Config.DefaultPortConfig | `
Select-Object -Property Name,
   @{N="Allow Promiscuous";E=

{$_.Config.DefaultPortConfig.SecurityPolicy.AllowPromiscuous.Value}},
   @{N="Allow MAC Address Change";E=

{$_.Config.DefaultPortConfig.SecurityPolicy.MacChanges.Value}},
   @{N="Allow Forged Transmits";E=

{$_.Config.DefaultPortConfig.SecurityPolicy.ForgedTransmits.Value}}

How can i list security settings of the dvP´s from that distributed switches?

regards

Fred

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Nearly the same structure

foreach($dvSw in (Get-View -ViewType VmwareDistributedVirtualSwitch -Property Name,Portgroup)){
    Get-View $dvSw.Portgroup | %{
        $_ | Select-Object -Property @{N="dvSwitch";E={$dvSw.Name}},
        Name,
        @{N="Allow Promiscuous";E={$_.Config.DefaultPortConfig.SecurityPolicy.AllowPromiscuous.Value}},
        @{N="Allow MAC Address Change";E={$_.Config.DefaultPortConfig.SecurityPolicy.MacChanges.Value}},
        @{N="Allow Forged Transmits";E={$_.Config.DefaultPortConfig.SecurityPolicy.ForgedTransmits.Value}}
    }
}


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Nearly the same structure

foreach($dvSw in (Get-View -ViewType VmwareDistributedVirtualSwitch -Property Name,Portgroup)){
    Get-View $dvSw.Portgroup | %{
        $_ | Select-Object -Property @{N="dvSwitch";E={$dvSw.Name}},
        Name,
        @{N="Allow Promiscuous";E={$_.Config.DefaultPortConfig.SecurityPolicy.AllowPromiscuous.Value}},
        @{N="Allow MAC Address Change";E={$_.Config.DefaultPortConfig.SecurityPolicy.MacChanges.Value}},
        @{N="Allow Forged Transmits";E={$_.Config.DefaultPortConfig.SecurityPolicy.ForgedTransmits.Value}}
    }
}


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

0 Kudos
fredlock
Contributor
Contributor
Jump to solution

Works great!

Thanks again LucD

regards

fred

0 Kudos