Skip to main content

Retrieve the list of users with licenses

Information

You can download the script for retrieving the list of users from this link.

Prerequisites

  • The Active Directory module for PowerShell installed on Windows Server.
  • A working Axidian Access server.
  • The user on whose behalf the script will be run must have the minimal global Inspector rights in the Axidian Access system.

How the script works

The script generates a CSV-format table with the following columns:

  • <UserName>,
  • <true>,
  • <false>,

where true\false are the columns with the corresponding license name.

The array of licenses whose presence is checked for the user is the list of all registered licenses.

The operation of the script consists of several stages:

  1. An array of licenses loaded into the system is generated using the /license/getAllLicenses method.
  2. Using the /api/v5/policy/get method, information about the policy is requested.
  3. From the scope property, information about the configured objects is requested using the /api/v5/userCatalog/getObjects method.
  4. From the obtained objects, users are requested:
  5. Using the license/getCatalogObjectLicenses method, the presence of the user's licenses is requested and compared with the overall array of licenses.
  6. Using the addDataToCSV function of the file Base/AdditionalFunctions/CsvReport.ps1 a table in CSV format is assembled.

Configuration

For the script to work, you need to configure the Config.ps1 file, which is located in the root of the folder with the script.

In the file:

  • $serverUrl — URL of the Axidian Access server. Required parameter.
  • $logsOnFile — enabling\disabling logging to a file. Required parameter. Enabled by default.
  • $logsOnConsole — enabling\disabling logging to the console. Required parameter. Disabled by default.
  • $apiVersion — version of the API used in the script. Required parameter. Default value: v5.
  • $policyIdspolicy identifiers, from whose scope the users are requested.
  • $csvPathToReport — path to the CSV report file. By default the file is created in the script folder at the path Reports\Statistics.

Example of execution

  1. To run the script, execute the file main.ps1.
  2. During the execution of the script, a CSV-format file will be created at the path from the $csvPathToReport variable.