Hi All,
I am unable to get the license expiration details as it shows blank
$LicenseManager= Get-view LicenseManager
$LicenseAssignmentManager= Get-View $LicenseManager.LicenseAssignmentManager
$LicenseAssignmentManager.GetType().GetMethod("QueryAssignedLicenses").Invoke($LicenseAssignmentManager,@($null)) |
Select EntityDisplayName,
@{N='Product';E={$_.Properties | where{$_.Key -eq 'ProductName'} | select -ExpandProperty Value}},
@{N='Product Version';E={$_.Properties | where{$_.Key -eq 'FileVersion'} | select -ExpandProperty Value}},
@{N='License';E={$_.AssignedLicense.LicenseKey}},
@{N='License Name';E={$_.AssignedLicense.Name}},
@{N='Used License';E={$_.Properties | where{$_.Key -eq 'EntityCost'} | select -ExpandProperty Value}},
@{N='Total';E={$_.AssignedLicense.Total}},
@{N='ExpirationDate';E={$_.Properties | where{$_.Key -eq 'expirationDate'} | select -ExpandProperty Value}}
#| Export-Csv c:\license_report.csv -NoTypeInformation -UseCulture