VMware Cloud Community
tjurgens
Enthusiast
Enthusiast
Jump to solution

List Edge Gateways and their version - PowerCLI

I am looking for a way to list all Edge Gateways deployed in all my ORG VDCs within my vCD 5.6.4 instance.

Does anyone have any documentation or examples of how I can find these Edge Gateways and their versions using PowerCLI?

vCD 5.6.4 doesn't really make it easy to know if the Edge Gateway is out of date.  I know I can look through vShield Manager, but that interface is not the most appealing to use when there are a few hundred Edge Gateways in existence.  A way to find this information using PowerCLI would allow me to list, sort and notify customers.

It makes it far easier to upgrade as well if we have up to date Edge Gateways.

Has anyone done this before?

1 Solution

Accepted Solutions
AdamRushUK
Enthusiast
Enthusiast
Jump to solution

I answered this in another post, but I'll add here for reference too...


I wanted to do the same, so I did this today:


# Author: Adam Rush

# Created on: 2016-05-28

# Finds all upgradeable vShield Edges and exports CSV file to Desktop

$reportPath = "$HOME\Desktop\upgradable-VSEs.csv"

$report = @()

Write-Host "Searching for all vShield Edges..." -ForegroundColor Yellow

$edges = Get-View -ViewType virtualmachine -Property Name,Config -Filter @{'Config.VAppConfig.Product[0].Name'='vShield Edge'} | % {

$edge = '' | Select 'Name','Version'

$edge.Name = $_.Name

$edge.Version = $_.config.vappconfig.product[0].version

$report += $edge

}

$highestVersion = ($report | Sort version -Descending)[0].version

Write-Host "Highest vShield Edge version: $highestVersion" -ForegroundColor Yellow

Write-Host "Exporting upgradeable vShield Edges..." -ForegroundColor Yellow

$upgradableVSEs = $report | Where {$_.version -lt $highestVersion}

Write-Host "Saving file to: $reportPath" -ForegroundColor Yellow

$upgradableVSEs | Export-Csv -Path $reportPath -NoTypeInformation -UseCulture

VCP-Cloud | VCP5-DCV | MCITP:EA | MCSE | CCNA | CCAA LinkedIn: https://www.linkedin.com/in/adamrushuk | Twitter : @adamrushuk

View solution in original post

3 Replies
AdamRushUK
Enthusiast
Enthusiast
Jump to solution

I answered this in another post, but I'll add here for reference too...


I wanted to do the same, so I did this today:


# Author: Adam Rush

# Created on: 2016-05-28

# Finds all upgradeable vShield Edges and exports CSV file to Desktop

$reportPath = "$HOME\Desktop\upgradable-VSEs.csv"

$report = @()

Write-Host "Searching for all vShield Edges..." -ForegroundColor Yellow

$edges = Get-View -ViewType virtualmachine -Property Name,Config -Filter @{'Config.VAppConfig.Product[0].Name'='vShield Edge'} | % {

$edge = '' | Select 'Name','Version'

$edge.Name = $_.Name

$edge.Version = $_.config.vappconfig.product[0].version

$report += $edge

}

$highestVersion = ($report | Sort version -Descending)[0].version

Write-Host "Highest vShield Edge version: $highestVersion" -ForegroundColor Yellow

Write-Host "Exporting upgradeable vShield Edges..." -ForegroundColor Yellow

$upgradableVSEs = $report | Where {$_.version -lt $highestVersion}

Write-Host "Saving file to: $reportPath" -ForegroundColor Yellow

$upgradableVSEs | Export-Csv -Path $reportPath -NoTypeInformation -UseCulture

VCP-Cloud | VCP5-DCV | MCITP:EA | MCSE | CCNA | CCAA LinkedIn: https://www.linkedin.com/in/adamrushuk | Twitter : @adamrushuk
tjurgens
Enthusiast
Enthusiast
Jump to solution

That's beautiful.  Thanks so much AdamRushUK‌ !

Snippit of the output with full edge names redacted.

pastedImage_1.png

0 Kudos
AdamRushUK
Enthusiast
Enthusiast
Jump to solution

Glad to be of service Smiley Happy

VCP-Cloud | VCP5-DCV | MCITP:EA | MCSE | CCNA | CCAA LinkedIn: https://www.linkedin.com/in/adamrushuk | Twitter : @adamrushuk