- 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:
List_All_Rds_Cals.csv
List_All_KeyPack.csv
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.
The BAS import uses the “Use physical tables” options that you can activate only with the full version of the Business Adapter Studio
“View advanced options” must be set to configure the use of a physical table.
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.
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.
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)
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.
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.
Scheduled_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.
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:
- Install the full version of the Business Adapter on the beacon.
- Create a service user that will have the appropriate rights.
- Open the ports between the beacon and the AD that contains the RDS License server(s) information. (Normally, is already open).
- Enable Active Directory querying by PowerShell (install PowerShell active Directory Module).
- Make sure that the RDS servers will authorize the Web Service queries by the service user that will run the PowerShell.
- 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.
Example of the staging database content that converts the RDS CAL servers information into allocations and optimal allocations
Related Articles
Importing Citrix Console License Consumption Information and Allocating to licenses to ITAM / FlexNet Manager 10Number of Views CAL and SaaS licenses do not appear in Licenses tab of user properties 6Number of Views Retired Microsoft User CAL licenses still showing consumption even after reconciliation 6Number of Views SaaS User licenses may overconsume when allocating users which are associated with multiple accessing users 6Number of Views Incorrect Consumption shown for CAL Licenses 8Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago