PowerCLI

  • 1.  Script to get number of CPU in evaluation mode.

    Posted Jul 09, 2015 10:28 PM

    Hi team,

    I would like to know the total number of CPUs which is under evaluation mode. The script i created is as below.

    $ServiceInstance = Get-View ServiceInstance

    $Eval = (Get-View ($ServiceInstance | Select -First 1).Content.LicenseManager | select -ExpandProperty licenses | ? {$_.Name -match "Evaluation mode"}| select Used| Measure-Object -Property Used -sum).Sum

    Write-host "$Eval"

    Using this format, i got the license count of licensed CPUs, but unable to get for evaluation mode, Am not sure what is missing.

    Can some one help me please.

    Output required:

    If there are 4 hosts with 2 CPU each running in evaluation mode , i need output as  "8"



  • 2.  RE: Script to get number of CPU in evaluation mode.

    Posted Jul 10, 2015 11:04 AM

    Any help please....



  • 3.  RE: Script to get number of CPU in evaluation mode.
    Best Answer

    Posted Jul 10, 2015 04:28 PM

    That was my mistake...

    The correct entry is as below.

    $ServiceInstance = Get-View ServiceInstance

    $Eval = (Get-View ($ServiceInstance | Select -First 1).Content.LicenseManager | select -ExpandProperty licenses | ? {$_.Name -match "Product Evaluation"}| select Used| Measure-Object -Property Used -sum).Sum

    Write-host "$Eval"