
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Exporting and importing Security rules using Qlik-Cli
Jun 2, 2021 2:35:51 PM
Sep 28, 2017 10:16:59 AM
Scenario:
- 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)
- 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

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi i try to use the above qlik-cli commands.
The export works well n oproblem, but when i try to import the security rules, i got the error
Invoke-RestMethod : The remote server returned an error: (403) Forbidden.
At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\functions\core.ps1:65 char:23
+ ... $result = Invoke-RestMethod @paramInvokeRestMethod @params
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Anyone an idea what the problem is and an idea how i can resolve this?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello @Jio
As we do not provide direct support for this tool, I would recommend that you contact the Qlik-CLI subject matter experts directly. You can do so here: https://github.com/ahaydon/Qlik-Cli-Windows/issues
All the best,
Sonja