In one of my previous posts you can find a PowerCLI script to report the dvPortgroup ports usage. In this post you’ll find a PowerCLI script to report the overall status of the dvSwitches in your environment. The script will report the dvSwitch Name, Version, Total ports maximum, Total ports in use and the total ports left on the dvSwitch.
Just copy the script below:
$dvSwitchInfo = @() foreach($dvSwitch in (get-virtualSwitch -distributed |Sort Name)){ $details = "" | Select Name, Version, Totalports, Portsinuse, Portsleft $totalPorts = $dvSwitch.ExtensionData.Config.MaxPorts $Portsinuse = $dvSwitch.ExtensionData.Config.NumPorts $portsleft = ($totalPorts - $Portsinuse) $details.Name = $dvSwitch.name $details.Version = $dvSwitch.ExtensionData.Summary.ProductInfo.Version $details.Totalports = $totalPorts $details.Portsinuse = $Portsinuse $details.Portsleft = $portsleft $dvSwitchInfo += $details } $dvSwitchInfo
The output will look like this:
I will create another script to combine the information of the dvSwitch and the dvPortgroups available on the dvSwitch to a complete html report like the vCheck.
Could you make it a plugin for the vCheck?