Qlik Community

Knowledge

Search or browse our knowledge base to find answers to your questions ranging from account questions to troubleshooting error messages. The content is curated and updated by our global Support team

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS

Exporting and importing Security rules using Qlik-Cli

cancel
Showing results for 
Search instead for 
Did you mean: 
Andre_Sostizzo
Digital Support
Digital Support

Exporting and importing Security rules using Qlik-Cli

Scenario:

  1. Have Qlik-Cli installed and configured (see How to install Qlik-CLI for Qlik Sense on Windows) for more insight on how to install and configure Qlik-Cli)
  2. Create a PowerShell script using the following code as a base:

! Note that the code is provided as is and will need to be modified to suit specific needs. For assistance, please contact the original creators of Qlik-Cli.

Connect-Qlik -computername "QlikSenseServer.company.com"
# This will export the custom security rules and output them as secrules.json
Get-QlikRule -filter "type eq 'Custom' and category eq 'security'" -full -raw  | ConvertTo-Json  | Out-File secrules.json
# This will import secrules.json into a Sense site
# The ideal use case would be to move the developedsecurity rules from one environment to another, so connecting to another Sense site would likely be needed here
Get-Content -raw .\secrules.json |% {$_ -replace '.*"id":.*','' } | ConvertFrom-Json | Import-QlikObject

Environment:

Qlik Sense Enterprise on Windows , all versions

Labels (2)
Version history
Last update:
‎2021-06-02 02:35 PM
Updated by: