4 Replies Latest reply on Aug 4, 2017 1:13 AM by vijayrana968

    Use POwercli to get License expiration dates

    moonrox Lurker

      I found and am using the code below to print license information.  However i am looking for the expires date of the license and I don't see a way to get that.


      Here is an example......  I would like to modify this to also include the license expires data. The data is available in the full GUI.  So I should be able to get it.



      = “C:\scripts\vcenter\LicenseInformation.csv“

      If ((Get-View ServiceInstance).Content.About.Version-ge “4.0.0“){

      $ServiceInstance = Get-View ServiceInstance

      $LicenseMan = Get-View $ServiceInstance.Content.LicenseManager

      $vSphereLicInfo = @()

      Foreach ($License in $LicenseMan.Licenses){

      $Details = “”

      |Select Name, Key, Total, Used,Information


      .Name= $License.Name


      .Key= $License.LicenseKey


      .Total= $License.Total


      .Used= $License.Used


      .Information= $License.Labels |Select -expand Value


      += $Details



      |Select Name, Key, Total, Used,Information |Export-Csv -NoTypeInformation $filename






      “Sorry V4 Only“