How to see the license usage of the Robots?
Issue Overview: Depending on the use case, the number of days of use of different Robot licenses may be required.
Resolution:
The information about Robot license consumption can be obtained from the Orchestrator database by performing the following steps:
- Connect to the database server
- Open the SQL Server Management Studio (SSMS)
- Connect to the Database using the preferred method (SQL Auth, Windows Auth, or any other)
- Navigate to the dbo.RobotLicenseLogs table by going to Databases > select the Orchestrator Database (by default is "UiPath") > expand the Tables
- Note: This table contains two columns called StartDate and EndDate in whose fields the information of when a Robot was connected and when it was disconnected from Orchestrator is stored. If the value of the EndDate column is NULL, it means that the Robot remains connected to the Orchestrator
- It is possible to obtain the difference between StartDate and EndDate by using the DATEDIFF function. This takes three arguments: the time unit to calculate the difference (in this case, "minute" for minutes), the start date, and the end date. The function can also receive as the time unit, "year", "month", "week", "day", "hour", "second", "millisecond", and others.
- Note: This is an example of how information can be obtained from this table, the query executed will depend on the need for each case. The following example returns the number of minutes the Robot with ID #4 (admin_1) spent connected to the Orchestrator.
Additional Information:
- In each Robot machine, under the folder path %userprofile%\AppData\Roaming\UiPath\ there is a file called UsageHistory.json which contains information regarding the license usage and UiPath Studio
- The Swagger API call /api/Stats/GetConsumptionLicenseStats will not work for this use case since the call retrieves the information of the licenses being consumed at the Tenant level in Orchestrator.