Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Mar 11, 2024 3:51:03 AM
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).
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
qlik user ls --limit 1000 > tenantusers.json
[
{
"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"
}
]
qlik user ls --limit 1000 | ConvertFrom-Json | ConvertTo-Csv > tenantusers.csv
@Daniele_Purrone wondering if there is a typo here, an extra "s" in user?
"qlik user ls > tenantusers.json"
instead of
"qlik users ls > tenantusers.json"
Note: "qlik users ls" doesn't work for me, "qlik user ls" does.
Thank you!
Hi @William_Wistam ,
definitely a typo! Thanks for spotting it, I have fixed it!
@Daniele_Purrone - I am able to export users but only few (count : 25) however we have more than 5000 users.
Hi @sanrout ,
yes, that's the standard limit.
You can increase that by adding a "--limit 100" and get 100 users instead.
Unfortunately, it's not possible to go over 100 in one batch, because that's a limitation of the API calls.
So, a solution is to build some script that uses the "--filter" option and then build different filters to capture the whole list of users, according to the syntax specified at https://datatracker.ietf.org/doc/rfc7644
Hi @sanrout , I have updated the articles with some scripts to go around the limitation. Can you please check? Thanks!
Hi @Daniele_Purrone , it is working ! thank you.
Thanks for the feedback @sanrout ! Can I ask you if you used the powershell one or the bash one?
@Daniele_Purrone - It is the powershell script, JSON file size is ~5 GB !!
@Daniele_Purrone - can we get the tenantusers.json output in CSV format using CLI ? Currently we convert the data into csv using online tools after exporting the data into json format.
Hi @sanrout , not with the qlik-cli, but you can use the native powershell commands.
If you have already created the tenantusers.json file, you can run:
Get-Content ./tenantusers.json |ConvertFrom-Json | ConvertTo-Csv > tenantusers.json
If you want to do everything in just one command you can run
qlik user ls --limit 100 |ConvertFrom-Json | ConvertTo-Csv > tenantusers.csv