LucD
Leadership
Leadership

You could do something like this

Get-VMHost -PipelineVariable esx |
    ForEach-Object -Process {
        $esxcli = Get-EsxCli -VMHost $esx -V2
        $esxcli.network.firewall.ruleset.list.Invoke() |
            where { $_.Name -match "^CIM" -and $_.Enabled -eq 'true' }
            ForEach-Object -Process {
                $esxcli.network.firewall.ruleset.set.Invoke(@{
                        enabled   = $true
                        rulesetid = $_.Name
                    })
            }
        }


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

View solution in original post

Reply
0 Kudos