Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT

Qlik Cloud: export list of tenant users to file

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Daniele_Purrone
Support
Support

Qlik Cloud: export list of tenant users to file

Last Update:

Mar 11, 2024 3:51:03 AM

Updated By:

Daniele_Purrone

Created date:

Apr 5, 2023 4:04:01 AM

It is possible to export the list of tenatnt users to a .json file using the "user ls" command from the Qlik Command Line Interface (qlik-cli).

 

Environment

 

Resolution

 

The scripts provided in this article are provided as they are and they are for guidance only.   

 

As a tenant admin, download and configure the Qlik-cli 

 

  1. run

    qlik user ls --limit 1000 > tenantusers.json​


    (please note: the qlik-cli is able to paginate over the limit of 100 users that concerns the API it uses. So, setting a higher limit will produce the full list of users). 

    in a command prompt or UNIX shell. The resulting tenantusers.json file will be saved in the current path for the prompt/shell  and will be in this format, with the roles defined on top and the user details under them.

    [
      {
        "assignedGroups": [],
        "assignedRoles": [
          {
            "id": "608050f7634644db3678b1a2",
            "level": "user",
            "name": "Developer",
            "type": "default"
          },
          {
            "id": "608050f7634644db3678b17f",
            "level": "admin",
            "name": "TenantAdmin",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af862",
            "level": "user",
            "name": "SharedSpaceCreator",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af866",
            "level": "user",
            "name": "ManagedSpaceCreator",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af86b",
            "level": "user",
            "name": "DataSpaceCreator",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af85d",
            "level": "admin",
            "name": "AnalyticsAdmin",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af85f",
            "level": "admin",
            "name": "DataAdmin",
            "type": "default"
          },
          {
            "id": "63580b8d5cf9728f19217be0",
            "level": "user",
            "name": "PrivateAnalyticsContentCreator",
            "type": "default"
          },
          {
            "id": "6356f0425cf9728f1962b942",
            "level": "user",
            "name": "DataServicesContributor",
            "type": "default"
          }
        ],
        "created": "2020-05-18T09:38:29.214Z",
        "createdAt": "2020-05-18T09:38:29.214Z",
        "email": "martina.testoni@dkdaklaldkdaklladaaddddl.com",
        "id": "USERID1",
        "lastUpdated": "2023-04-04T07:32:00.756Z",
        "lastUpdatedAt": "2023-04-04T07:32:00.756Z",
        "name": "Martina Testoni",
        "picture": "https://s.gravatar.com/avatar/gravatarimage=pg\u0026d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fdp.png",
        "preferredLocale": "",
        "preferredZoneinfo": "Europe/Copenhagen",
        "roles": [
          "Developer",
          "TenantAdmin",
          "SharedSpaceCreator",
          "ManagedSpaceCreator",
          "DataSpaceCreator",
          "AnalyticsAdmin",
          "DataAdmin",
          "PrivateAnalyticsContentCreator",
          "DataServicesContributor"
        ],
        "status": "active",
        "subject": "auth0|SUBJECTID2",
        "tenantId": "TENANTID"
      },
      {
        "assignedGroups": [],
        "assignedRoles": [
          {
            "id": "608050f7634644db3678b17f",
            "level": "admin",
            "name": "TenantAdmin",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af86b",
            "level": "user",
            "name": "DataSpaceCreator",
            "type": "default"
          },
          {
            "id": "608050f7634644db3678b1a2",
            "level": "user",
            "name": "Developer",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af866",
            "level": "user",
            "name": "ManagedSpaceCreator",
            "type": "default"
          },
          {
            "id": "63580b8d5cf9728f19217be0",
            "level": "user",
            "name": "PrivateAnalyticsContentCreator",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af862",
            "level": "user",
            "name": "SharedSpaceCreator",
            "type": "default"
          },
          {
            "id": "6356f0425cf9728f1962b95c",
            "level": "user",
            "name": "Steward",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af85d",
            "level": "admin",
            "name": "AnalyticsAdmin",
            "type": "default"
          },
          {
            "id": "62bb165356d1879582c1b468",
            "level": "admin",
            "name": "AuditAdmin",
            "type": "default"
          },
          {
            "id": "605a1c2151382ffc836af85f",
            "level": "admin",
            "name": "DataAdmin",
            "type": "default"
          }
        ],
        "created": "2023-03-31T08:44:37.332Z",
        "createdAt": "2023-03-31T08:44:37.332Z",
        "email": "Gentile.Faccenda@dkdaklaldkdaklladaaddddl.com",
        "id": "USERID2",
        "lastUpdated": "2023-04-03T11:24:35.037Z",
        "lastUpdatedAt": "2023-04-03T11:24:35.037Z",
        "name": "Gentile Faccenda",
        "picture": "https://s.gravatar.com/avatar/randomurl=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Fdp.png",
        "roles": [
          "TenantAdmin",
          "DataSpaceCreator",
          "Developer",
          "ManagedSpaceCreator",
          "PrivateAnalyticsContentCreator",
          "SharedSpaceCreator",
          "Steward",
          "AnalyticsAdmin",
          "AuditAdmin",
          "DataAdmin"
        ],
        "status": "active",
        "subject": "auth0|IDPSUBJECT2",
        "tenantId": "TENANTID"
      }
    ]
    

     

  2. Use any tool you like (online or not) to convert the json to csv, xlsx or other format. 

    In a PowerShell you can generate the users natively in csv format by using:

    qlik user ls --limit 1000 | ConvertFrom-Json | ConvertTo-Csv > tenantusers.csv​

 

Related Content

 

 

Comments
Braveen
Contributor III
Contributor III

Hi @Daniele_Purrone,

User name, email and many other info are getting downloaded as part of the command line. But, Is there a way to get the entitlement of the user as well? 

There is a status data point as part of the file but it is active for inactive users. 

Thanks

Daniele_Purrone
Support
Support

Hi @Braveen ,

entitlements are not included in the API calls for users.

A possible workaround is to use the Entitlement Analyzer app, which combines information collected from different endpoints.

You could then a sheet with a simple table containing the fields you want to export, and then download the table as an Excel file:

Daniele_Purrone_0-1712584157877.png


The Entitlement Analyzer is part of the cloud monitoring apps, which can be installed easily via an automation workflow.

Contributors
Version history
Last update:
‎2024-03-11 03:51 AM
Updated by: