Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

Qlik Cloud: Delete license allocation with Qlik-CLI

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
Daniele_Purrone
Support
Support

Qlik Cloud: Delete license allocation with Qlik-CLI

Last Update:

Nov 15, 2023 8:13:25 AM

Updated By:

Sonja_Bauernfeind

Created date:

Apr 4, 2023 5:39:18 AM

Assigned Qlik Cloud licenses and entitlements can be deallocated using the Qlik Command Line Interface. This method is specifically useful when the user with the allocated entitlement or license is no longer visible in the system and can therefore not be configured in the Management Console. 

Resolution

  1. Download and configure the Qlik-cli 
  2. Open PowerShell or UNIX shell
  3. Run qlik license assignment ls to obtain a list of currently assigned licenses:
    [                     
      {
        "created": "2023-04-03T11:24:05.101Z",
        "excess": false,
        "name": “Enzo Bearzot”,
        "subject": "auth0|12345678”,
        "type": "professional",
        "userId": “userid1”
      },
      {
        "created": "2022-08-17T11:50:04.647Z",
        "excess": false,
        "name": “Vittorio Pozzo”,
        "subject": "auth0|910111213”,
        "type": “analyzer”,
        "userId": “userid2”
      },
      {
        "created": "2022-08-17T11:50:04.647Z",
        "excess": false,
        "name": “Ferruccio Valcareggi”,
        "subject": "auth0|14151617”,
        "type": "professional",
        "userId": “userid3”
      },
      {
        "created": "2022-06-07T11:36:15.704Z",
        "excess": false,
        "subject": “18192021”,
        "type": “professional”
      },
      {
        "created": "2022-06-03T13:50:14.105Z",
        "excess": false,
        "subject": “22232425”,
        "type": "analyzer"
      },
    ]
    ​
  4. Identify any user whose license you want to remove.

    There is a higher probability that you'll find them among the users who have no "name:" and "userid:" fields.

  5. Construct the following string for each user:

    The syntax below is for Unix shells. For usage in Windows Powershell add a "backslash" before each "doublequote" sign. '[{"subject"... will have to become '[{\"subject\"...

    '[{"subject":"USERSUBJECT","type":"ASSIGNEDLICENSE"}]'

    Example: Using the last user in the list provided above, the string would be:

    '[{"subject":"22232425","type":"analyzer"}]'

  6. Feed the string into this command:

    .\qlik.exe license assignment delete --delete STRING

    With the example above you will run:

    Example using the last user in the list above:

    .\qlik.exe license assignment delete --delete '[{"subject":"22232425","type":"analyzer"}]'
  7. Run the command and wait for the result.

    A status returned as 200 will confirm the removal worked:

    % qlik license assignment delete --delete '[{"subject":"22232425","type":"analyzer"}]'
    [                    
      {
        "status": 200,
        "subject": "22232425",
        "type": "analyzer"
      }
    ]
    
  8. Verify the allocation was removed by navigating to the Qlik Cloud Management Console's Home section.

     

Related Content

 

Environment

Qlik Cloud 

 

 

Comments
Ken_T
Specialist
Specialist

is there a way to do this in the CONSOLE for a single user?

Daniele_Purrone
Support
Support

Hi @Ken_T , if the user is visible, which is in the almost-entirety of cases, then it is possible

There are some scenarios where the user is hidden, or was deleted, then the problem can be solved via the API calls. The qlik-cli is a easier-to-use interface for the API calls, and it allows to do more than what you can do on the console.

Ken_T
Specialist
Specialist

this sounds like a dumb question, but to remove a persons license in the console (without causing any issues or orphaned records should they come back to log in later) - is that done by using the "disable" option for the user?    What would be the proper steps to manually, in the console, to remove a users license? to prevent any future issue should they log in later.

Daniele_Purrone
Support
Support

Hi @Ken_T , that is done via the "Removing user entitlement" instructions that you can find here: https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Admin/SaaS-user-allocati... 

Ken_T
Specialist
Specialist

thanks  --we will test that to make sure it works, then work on doing the CLI script to do this. Removing the entitlement for the user, should free up the license, and then if the user comes back in the future, if dynamic assignment of entitlements (license) is on - they should get a new one, and all their old content, apps, connections etc should still be there for them. right?

I heard that there may be a new block coming to automation to help with doing this in SAAS/QCG, in the future. Platform Operations block... Can you confirm this is coming soon?

Satomi
Partner - Contributor III
Partner - Contributor III

Windows PowerShell required escaping of double quotes and \ symbols.
It may depend on the environment,I hope this helps someone who has encountered the same problem.

Example
qlik license assignment delete --delete '[{\"subject\":\"domain\\user1\",\"type\":\"analyzer\"}]'スクリーンショット 2023-11-22 113504.png

 

Version history
Last update:
‎2023-11-15 08:13 AM
Updated by: