Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 175326

use Get-VDPortgroup cmdlet in the VDS component

$
0
0

Hello

 

I'm using the below script to get VDS Port Group it's working fine but I'm getting the warring message:

 

WARNING: The output of the command produced distributed virtual portgroup objects. This behavior is obsolete and may change in the future. To retrieve distributed portgroups, use Get-VDPortgroup cmdlet in the VDS component. To retrieve standard portgroups, use -Standard.

 

I would like to understand why I'm getting this warrning and how I car relidiate using the similar way used in my script?

 

Get-VMHost -PipelineVariable ESX | Get-VirtualPortGroup | Select-Object @{N='VMHost';E={$esx.Name}},VirtualSwitch,Name,VlanId | Out-String | ForEach-Object { $_.Trim() } > ".\VDSportGroup.txt"

#Verify if VlanID is set to 0 or 1, if so, then Check Get-VirtualPortGroup-Config.txt

$CheckVlanID = (Get-Content .\VDSportGroup.txt | Format-Table VlanId | findstr /v " _$Null VlanId ----- _$Null") | where-object {$_ -like '*0*' -like '*1*'} | ForEach-Object{$_.split(".")[0]}

function VDSPort{

        if ($Null -eq $CheckVlanID) {

            Write-Log -StartTab 1 -LinesBefore 1 -Level Success -Message "All Hosts have VlanID configured with value between 2 and 4094 " -FilePath $LogFile

            }

        else {

            Write-Host -f red "Hosts with wrong VlanID detected"

            Write-Log -StartTab 1 -LinesBefore 1 -Level Success -Message "Check Get-VirtualPortGroup-Config file for host(s) $CheckVlanID" -FilePath $LogFile

            }

}

VDSPort


Viewing all articles
Browse latest Browse all 175326

Trending Articles