<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Exporting and importing Security rules using Qlik-Cli in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/ta-p/1717288</link>
    <description>&lt;P&gt;Scenario:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Have&amp;nbsp;&lt;A href="https://github.com/ahaydon/Qlik-Cli" target="_blank" rel="noopener"&gt;Qlik-Cli&lt;/A&gt;&amp;nbsp;installed and configured (see&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Knowledge-Base/How-to-install-Qlik-CLI-for-Qlik-Sense-on-Windows/ta-p/1715387" target="_blank" rel="noopener"&gt;How to install Qlik-CLI for Qlik Sense on Windows&lt;/A&gt;) for more insight on how to install and configure Qlik-Cli)&lt;/LI&gt;
&lt;LI&gt;Create a PowerShell script using the following code as a base:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN style="color: #c0392b;"&gt;&lt;SPAN style="font-size: 22px;"&gt;&lt;STRONG&gt;!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; 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.&lt;/P&gt;
&lt;PRE class="ckeditor_codeblock"&gt;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&lt;/PRE&gt;
&lt;H3&gt;Environment:&lt;/H3&gt;
&lt;P&gt;&lt;LI-PRODUCT title="Qlik Sense Enterprise on Windows" id="qlikSenseEnterpriseWindows"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;, all versions&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jun 2021 18:35:51 GMT</pubDate>
    <dc:creator>Andre_Sostizzo</dc:creator>
    <dc:date>2021-06-02T18:35:51Z</dc:date>
    <item>
      <title>Exporting and importing Security rules using Qlik-Cli</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/ta-p/1717288</link>
      <description>&lt;P&gt;Scenario:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Have&amp;nbsp;&lt;A href="https://github.com/ahaydon/Qlik-Cli" target="_blank" rel="noopener"&gt;Qlik-Cli&lt;/A&gt;&amp;nbsp;installed and configured (see&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Knowledge-Base/How-to-install-Qlik-CLI-for-Qlik-Sense-on-Windows/ta-p/1715387" target="_blank" rel="noopener"&gt;How to install Qlik-CLI for Qlik Sense on Windows&lt;/A&gt;) for more insight on how to install and configure Qlik-Cli)&lt;/LI&gt;
&lt;LI&gt;Create a PowerShell script using the following code as a base:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN style="color: #c0392b;"&gt;&lt;SPAN style="font-size: 22px;"&gt;&lt;STRONG&gt;!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; 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.&lt;/P&gt;
&lt;PRE class="ckeditor_codeblock"&gt;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&lt;/PRE&gt;
&lt;H3&gt;Environment:&lt;/H3&gt;
&lt;P&gt;&lt;LI-PRODUCT title="Qlik Sense Enterprise on Windows" id="qlikSenseEnterpriseWindows"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;, all versions&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 18:35:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/ta-p/1717288</guid>
      <dc:creator>Andre_Sostizzo</dc:creator>
      <dc:date>2021-06-02T18:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting and importing Security rules using Qlik-Cli</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/tac-p/2046249#M8617</link>
      <description>&lt;P&gt;Hi i try to use the above qlik-cli commands.&lt;BR /&gt;The export works well n oproblem, but when i try to import the security rules, i got the error&lt;BR /&gt;Invoke-RestMethod : The remote server returned an error: (403) Forbidden.&lt;BR /&gt;At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\functions\core.ps1:65 char:23&lt;BR /&gt;+ ... $result = Invoke-RestMethod @paramInvokeRestMethod @params&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand&lt;BR /&gt;Anyone an idea what the problem is and an idea how i can resolve this?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 14:42:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/tac-p/2046249#M8617</guid>
      <dc:creator>Jio</dc:creator>
      <dc:date>2023-03-07T14:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting and importing Security rules using Qlik-Cli</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/tac-p/2048373#M8670</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/178668"&gt;@Jio&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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:&amp;nbsp;&lt;A href="https://github.com/ahaydon/Qlik-Cli-Windows/issues" target="_self"&gt;https://github.com/ahaydon/Qlik-Cli-Windows/issues&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best,&lt;BR /&gt;Sonja&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 09:47:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/tac-p/2048373#M8670</guid>
      <dc:creator>Sonja_Bauernfeind</dc:creator>
      <dc:date>2023-03-13T09:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Exporting and importing Security rules using Qlik-Cli</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/tac-p/2523319#M16071</link>
      <description>&lt;P&gt;The regex '.*"id":.*' is quite aggressive and will remove any line containing "id":, even if it is part of a string value. For a safer approach I would suggest:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Get-Content -raw .\test_secrules.json | ConvertFrom-Json | select-object * -ExcludeProperty id | Import-QlikObject -Verbose&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2025 07:01:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Exporting-and-importing-Security-rules-using-Qlik-Cli/tac-p/2523319#M16071</guid>
      <dc:creator>Giovanni_Civardi</dc:creator>
      <dc:date>2025-07-07T07:01:23Z</dc:date>
    </item>
  </channel>
</rss>

