esarakaitis
Enthusiast
Enthusiast

verify licensed features of a vmware host

$vmhostname = "vmhostname.domain.com"
Connect-VIServer $vmhostname | Out-Null
$vmhost = get-vmhost
$ServiceInstance = Get-View ServiceInstance
$LicManRef=$ServiceInstance.Content.LicenseManager
$LicManView=Get-View $LicManRef
$LicManView.featureinfo | Where-Object {$_.state -eq "enabled"} | `
    Select-Object      @{Name = "VMHost"; Expression = {$vmhost.name}},`
                       @{Name = "License Server"; Expression = {$licManView.source.LicenseServer}},`
                       @{Name = "Version"; Expression = {$licManView.LicensedEdition}},`
                       @{Name = "Feature"; Expression = {$_.key}}

http://www.vmwarescripting.com

0 Kudos
2 Replies
halr9000
Commander
Commander

Small style hint: FYI, it's not necessary to put a line continuation character after a pipe or a comma when they are at the end of the line.






[PowerShell MVP|https://mvp.support.microsoft.com/profile=5547F213-A069-45F8-B5D1-17E5BD3F362F], VI Toolkit forum moderator

Author of the upcoming book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

Need general, non-VMware-related PowerShell Help? Try the forums at PowerShellCommunity.org

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
0 Kudos
kcvman
Contributor
Contributor

Good script.... how would one go about adding a loop to cycle through all the hosts on a instance of a VC?

0 Kudos