cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Author: Nicolas Rousseau
  • Author Email Address: nrousseau@flexera.com
  • Solution Type: Integration
  • Flexera Product & Version: FlexNet  Manager / Flexera One ITAM
  • Environment: On Premises / Cloud
  • Development Effort (Days): 3
  • Implementation Effort (Days): 1
  • Disclaimer:

As this solution reads RDS License server data and builds the list of users and devices along with their allocated RDS licenses. The second step is a Business Adapter that allocates users to licenses and optimal licenses using direct SQL.

The solution requires advanced skills to understand and modify the SQL code.

The SQL involved in the “compute allocations” step requires to be adapted to the customer’s environment. For instance, if you have only maintained Microsoft User CALs, there is no need to check if a user was provided CALS of lower version… The SQL script “optimization portion” can just be skipped.

SOLUTIONS ARE PROVIDED ON AN "AS IS" BASIS. NEITHER FLEXERA NOR ITS SUPPLIERS MAKE ANY WARRANTIES, EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. LICENSEE MAY HAVE OTHER STATUTORY RIGHTS. HOWEVER, TO THE FULL EXTENT PERMITTED BY LAW, THE DURATION OF STATUTORILY REQUIRED WARRANTIES, IF ANY, WILL BE LIMITED TO THE SHORTER OF (I) THE STATUTORILY REQUIRED PERIOD OR (II) THIRTY (30) DAYS FROM LICENSEE’S ACCEPTANCE OF THE AGREEMENT.

Goal of the document and audience

This document gives the details for setting up a RDS Management solution that allows to collect automatically the RDS license server reports from each license server, and re import the data into FNMS / Flexera one, with allocations of users to RDS CALs licenses (current consumption) and Allocations of users to RDS Optimal licenses, applying a de duplication optimization logic.

The audience is Flexera or Flexera partner’s consultants or customers implementers with advanced SQL skills.

Implementation details

A PowerShell script collects the data from the RDS CAL license servers.

Detailed description

A PowerShell script (Query_and_Import_TSE-RDS_Licenses_From_TSLicenseServers.ps1):

  • Queries AD to get the list of RDS License servers (could be multiple AD servers in case of multiple domains with no trust)
  • Queries each on the RDS licenses servers using REST APIs to get the “RDS License Consumptions Reports”. This means ports have to be opened to access each of the RDS license server.
  • Stores the data in 2 files:
    • A flat list of users and computers actives licenses (List_All_Rds_Cals.csv).
    • A “CAL Type, CAL Version file” that contains the CALs license details (List_All_KeyPack.csv)

This PowerShell file can be found in the .\RDS Licenses\Query folder of the embedded zip file below and can be scheduled with a Windows Server scheduled task

Preview:

Picture1.png

List_All_Rds_Cals.csv

Picture2.png

List_All_KeyPack.csv

Picture3.png

Two Business Adapter Studio imports store the data in staging tables and compute allocations.

The full version of the Business Adapter is necessary as the next two Business Adapters feed the tables of a staging SQL database running SQL queries, but the solution works on FNMS Cloud / Flexera One

A first Business importer - AllRdsCalLicensesUsedFromTSServers.xml

The AllRdsCalLicensesUsedFromTSServers.xml  importer Imports into a staging database the RDS CALs details, with all key details first.

  • The importer imports the List_All_Rds_Cals.csv file.
  • The raw csv data is stored in the [dbo].[ECMImport_AllRdsCalLicensesUsedFromTSServers] table.

Picture4.png

 The BAS import uses the “Use physical tables” options that you can activate only with the full version of the Business Adapter Studio

Picture5.png

  “View advanced options” must be set to configure the use of a physical table.

Picture6.png

 There are two possibilities for this “physical table” location:

  • If you are on premise, the Business Adapter studio will create a table in the FNMSCompliance (or FNMP in older instances) database.
  • If you are a Cloud customer, you must install a SQL Server Instance, that you will “fake” to be a FlexNet Manager database (so that the Business Adapter Studio can write in it). To do so, you need to run the SQL script embedded on an empty SQL Server instance that will create a DatabaseConfiguration table and will insert a CMSchemaVersion with the “17” value (FlexNet Manager 2020), feel free to tune to make sure you Business Adapter is compatible with the declared version.

 

The second business adapter - AllRdsKeyPackFromTSServers.xml

The AllRdsKeyPackFromTSServers.xml import needs to be run or scheduled after the AllRdsCalLicensesUsedFromTSServers.xml business adapter as it uses, in the SQL step, data that has been imported or refreshed by this first Business Adapter. This second import has two steps:

  • An Import of the RDS CAL License Definitions data definitions
    • It imports the List_All_KeyPack.csv file.
    • The table that stores the raw license definition is: [dbo].[ECMImport_AllRdsKeyPackFromTSServers].
  • A SQL script that performs some data cleaning and calculations (optimizations etc) in the SQL steps.
    • This SQL step prepares the final allocations to “current consumptions” licenses and “Optimal Consumption” Licenses.
    • THIS SQL STEP NEEDS TO BE ADAPTED TO YOUR NEEDS. For instance, if you have only maintained Microsoft User CALs, there is no need to check if a user was provided CALS of lower version… The SQL script “optimization portion” can just be skipped.

The logic of optimal consumptions calculation is the following:

  • If a user has a 2012 and 2016 license (is declared on 2 license servers), he could have only a license of versions 2016 (version consolidation)
  • If a user has a device and a user RDS CAL, he should keep only one. Logic can be extended based on feedbacks!

The business adapter reads data and creates a raw RDS CALs definition table ([dbo].[ECMImport_AllRdsKeyPackFromTSServers]) and has two SQL steps, to create a second table (nr_RDSAllocations). This table stores the “joined” information (users RDS CALs and CALs name) and the calculated allocation or optimal allocations.

Picture7.png

It is recommended that you test the SQL code directly in SQL Server Management Studio after running the first and second importer that will load the raw RDS CAL data in the tables… then, you can paste the code from the “PopulateAllocationData” Business Adapter SQL step to understand what it does and tune it eventually.

 

SELECT * FROM nr_RDSAllocations will show you the full data.

Picture8.png

 This SQL code contains comments.

Customers with a Cloud instance need to import the user to device link information from a SOAP API (GetCustomViewResult) or REST API (ReportExecute)

Picture9.png

The ***Optimization section***can be tuned or ignored if the goal is to reflect the RDS licenses assigned to users and devices (current consumption) and not to identify potential optimizations.

Picture10.png

A Beacon Business Importer makes allocations.

The Beacon version (Cloud instance or on premises) of the Business adapter can be used to run the next two importers. You need to paste the two xml files in the beacon BAS folder (normally: C:\ProgramData\Flexera Software\Beacon\BusinessAdapter)

The Scheduled_LICENSE_Clear Previous MS RDS CAL Allocations.XML Business importer needs to be scheduled the next Business Adapter and cleans up all previous allocations from all RDS licenses. If your CAL data has allocations for all licenses, the update rule (“detach unfound computers (and users) from…”) will ensure the licenses have the current users and devices allocated. However, if a CAL is missing from the source data, no allocation will be created or deleted. Hence this safe “cleanup” step.

Picture11.pngScheduled_LICENSE_Allocate MS RDS CALs.XML that reads nr_RDSAllocations SQL table and performs allocations:

  • To RDS licenses (reflecting what are the currently allocated RDS CALs).
  • To “RDS Optimal” licenses.

The difference between the RDS license consumptions and the RDS Optimal license consumption shows the saving that could be obtained through rationalization of RDS license allocations in the license servers.Picture12.png

Prerequisites

The PowerShell script will be run from the beacons that are querying the Active Directory that contains the RDS license servers list… to then query each of the RDS servers and store the data into a local SQL db for processing.

The following preparation steps are necessary:

  1. Install the full version of the Business Adapter on the beacon.
  2. Create a service user that will have the appropriate rights.
  3. Open the ports between the beacon and the AD that contains the RDS License server(s) information. (Normally, is already open).
  4. Enable Active Directory querying by PowerShell (install PowerShell active Directory Module).
  5. Make sure that the RDS servers will authorize the Web Service queries by the service user that will run the PowerShell.
  6. Open Ports between the beacons and the RDS license server(s) (TCP 443).

Code

The code can be found in embedded files attached to this article. 

Picture13.png

 

Example of the staging database content that converts the RDS CAL servers information into allocations and optimal allocations

Picture14.png

Was this article helpful? Yes No
100% helpful (2/2)
Comments
Ronny_OO7
By Level 8 Champion
Level 8 Champion

Hi Nicolas,

Great work thank you! Can you please share the code and xls? At this moment these are pictures.

Also you mentioned: Create a service user that will have the appropriate rights. Can you please be more specific?

Regards

Ronald 

nrousseau1
By Level 10 Champion
Level 10 Champion

Hello @Ronny_OO7 / Ronald,

Everything is in the attached docx file! Regarding the Services user, to be honest, you need a use that has the rights to query the RDS License server APIs... but in reality, I have never struggled with this one (using the Flexera Service Account).

A topic that is trickier is: "which ports to open?". With some customers, there was nothing to do, with some other, some ports needed to be opened. Reading I have a feeling port 135 needs to be opened.

@jdempsey  may have more input on this. Jim, would you have information?

Thanks,

Nicolas

Ronny_OO7
By Level 8 Champion
Level 8 Champion

Hi Nicolas,

Thanks for your help and time. Ill double check this, and indeed it is good to know the ports that are required!

Regards

Ronald 

MWuendisch
By
Level 4

such articles are more then helpful 😉 more of these 😉

Version history
Last update:
‎Aug 30, 2023 09:50 AM
Updated by: