locked
Powershell - Server 2016 - RDS License Report issues RRS feed

  • Question

  • I have been using a script to generate an RDS PerUser CAL usage report in my server 2012 environments which works with no issues. I have been upgrading my license servers to Server 2016 and since doing so, it will no longer pull the license count. Both the Issued and Installed counts return a value of "0". I have modified the script to take into account "Win8" vs. "Win2k8-Win2k8R2" used for Server 2012. Please see the script below; any help is appreciated. Again, this works as intended in 2012R2.

    # Create new RDS report
    Invoke-WmiMethod -Class Win32_TSLicenseReport -Name GenerateReportEx

    # Name is automatically generated
    $NewReportName = Get-ChildItem RDS:\LicenseServer\IssuedLicenses\PerUserLicenseReports -name

    # Get issued licenses 
    $IssuedLicenseCount = get-Childitem RDS:\LicenseServer\IssuedLicenses\PerUserLicenseReports\$NewReportName\Win8\IssuedCount

    # Count issued licenses 
    $IssuedLicenseCountValue = $IssuedLicenseCount.CurrentValue

    # Get installed licenses 
    $InstalledLicenseCount = get-item RDS:\LicenseServer\IssuedLicenses\PerUserLicenseReports\$NewReportName\Win8\InstalledCount

    # Count installed licenses 
    $InstalledLicenseCountValue = $InstalledLicenseCount.CurrentValue

    # Display Licenses
    Write-host “Installed: $InstalledLicenseCountValue”
    Write-host “Issued: $IssuedLicenseCountValue”

    Installed: 0
    Issued: 0


    • Moved by Bill_Stewart Tuesday, November 7, 2017 10:05 PM This is not RDS support forum
    Friday, September 22, 2017 7:34 PM

All replies

  • This would be better if posted in RDS forum.  RDS has a couple of license reports available but I don't remember how to find them

    Also look in Gallery for license reports.

    The following line is likely wrong.

    # Name is automatically generated
    $NewReportName = Get-ChildItem RDS:\LicenseServer\IssuedLicenses\PerUserLicenseReports -name

    Inspect the results.  The syntax is incorrect.  "-name" is not usable in that way.


    \_(ツ)_/

    Friday, September 22, 2017 9:06 PM
  • Thank you for the reply. I will also post in RDS Forum. I wanted to start here.

    "-name" is indeed usable in this line of syntax. All this does is create the report anyhow, which is not the issue; the report get's generated correctly. The issue is that it's not returning the correct number of licenses.

    Friday, September 22, 2017 9:16 PM