<?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 Recreating Qlik Sense root CA certificate when upgrading to June 2019 and above (script based back-up and removal of existing certificates) in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/ta-p/1712696</link>
    <description>&lt;BLOCKQUOTE class="quote"&gt;The following steps are only applicable to Qlik Sense deployments originally installed with versions&lt;STRONG&gt; prior to the June 2019 release&lt;/STRONG&gt;. For any Qlik Sense deployments installed with later versions, follow standard steps for patching Qlik Sense and do not perform the steps in this article.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In these steps we will occasionally ask you to run Powershell code.&lt;/P&gt;
&lt;P&gt;Executing PowerShell code:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Copy the code and save it in a ps1 file, in example: certificates_backup.ps1&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Open elevated command line and navigate to the location where the script was saved.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Start PowerShell by executing following command: Powershell&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Run the script by executing following command: .\&amp;lt;name_of_the_script&amp;gt;.ps1 in example: .\certificates_backup.ps1&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Environment&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Qlik Sense Enterprise on Windows, June 2019 thru November 2019&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;After upgrading to June 2019 or above, check the Root certificate by running the &lt;A href="https://github.com/StevenJDH/C2-Validator/releases" target="_blank" rel="noopener"&gt;C2 Validator&lt;/A&gt;&amp;nbsp;tool on&lt;STRONG&gt;&amp;nbsp;ALL NODES&lt;/STRONG&gt;. If CA and Critical&amp;nbsp;display 'Missing', please follow the instructions below.&lt;/LI&gt;
&lt;LI&gt;Stop &lt;STRONG&gt;all services&lt;/STRONG&gt; on &lt;STRONG&gt;ALL NODES&lt;/STRONG&gt; in the Qlik Sense cluster.&lt;/LI&gt;
&lt;LI&gt;Back up &lt;STRONG&gt;all current Qlik Sense certificates&lt;/STRONG&gt; from the &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt; by executing the following PowerShell code:&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

function ExportCertificatesFromStore(
    [string] $name,
    [string] $location)
{
    $success = 1
    $oid = "1.3.6.1.5.5.7.13.3"
    
    $localStore = new-object System.Security.Cryptography.X509Certificates.X509Store $name, $location
    $localStore.Open("MaxAllowed")

    $mypwd = ConvertTo-SecureString -String "MyPassword" -Force -AsPlainText

    try
    {
        $certs = $localStore.Certificates
        foreach ($cert in $certs)
        {
            $extensions = $cert.Extensions
            foreach($extension in $extensions)
            {
                if ($extension.Oid.Value.Equals($oid))
                {
                    Get-ChildItem -Path cert:\$($localStore.Location)\$($localStore.Name) | Where-Object { $_.PrivateKey.CspKeyContainerInfo.Exportable } | Export-PfxCertificate -FilePath "$($localStore.Name)_$($localStore.Location).pfx" -Password $mypwd
                    break;
                }
            }
        }
    }

    catch
    {
        write-host "An error occurred while removing certificates" -ForegroundColor Red
        write-host $_.Exception.GetType().FullName -ForegroundColor Red
        write-host $_.Exception.Message -ForegroundColor Red
        $success = 0
    }

    finally
    {
        $localStore.Close()
    }
    
    if ($success -ne 1)
    {
        exit 20
    }
}

function ExportCertificates()
{
    ExportCertificatesFromStore "Root" "LocalMachine"
    ExportCertificatesFromStore "My" "LocalMachine"
    ExportCertificatesFromStore "My" "CurrentUser"
}

ExportCertificates
write-host "Done."
exit 0&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; For information on how to execute above code please refer to “Executing PowerShell code” section at the top. Modify $mypwd variable to define custom password. Make sure certificates were backed up after running the script:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Root_LocalMachine.pfx – root CA&lt;/LI&gt;
&lt;LI&gt;My_LocalMachine.pfx – server&lt;/LI&gt;
&lt;LI&gt;My_CurrentUser – client&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; If you happen to have more certificates with the same values in Issued To, Issued By and Friendly Name columns and you are unable to identify the correct certificate, please refer to&amp;nbsp;&lt;A href="https://support.qlik.com/articles/000098419" target="_blank" rel="noopener"&gt;Identifying Qlik Sense root CA and server certificates in certificate store&lt;/A&gt;.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Remove &lt;STRONG&gt;current Qlik Sense root CA certificate &lt;/STRONG&gt;from &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt; by executing the following PowerShell code:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

function RemoveCertificatesFromStore(
[string] $name,
[string] $location)
{
    $success = 1
    $oid = "1.3.6.1.5.5.7.13.3"

    $localStore = new-object System.Security.Cryptography.X509Certificates.X509Store $name, $location
    $localStore.Open("MaxAllowed")
    try
    {
        $certs = $localStore.Certificates
        foreach ($cert in $certs)
        {
            $extensions = $cert.Extensions
            foreach($extension in $extensions)
            {
                if ($extension.Oid.Value.Equals($oid))
                {
                    write-host "Deleting certificate from" $localStore.Name $localStore.Location
                    write-host " Subject:"$cert.Subject
                    write-host " Issuer:"$cert.Issuer
                    write-host " Serial:"$cert.SerialNumber
                    $localStore.Remove($cert)
                    break;
                }
            }
        }
    }
    catch
    {
        write-host "An error occurred while removing certificates" -ForegroundColor Red
        write-host $_.Exception.GetType().FullName -ForegroundColor Red
        write-host $_.Exception.Message -ForegroundColor Red
        $success = 0
    }
    finally
    {
        $localStore.Close()
    }

    if ($success -ne 1)
    {
        exit 20
    }
}

function CleanCertificates()
{
    RemoveCertificatesFromStore "Root" "LocalMachine"
}

CleanCertificates
write-host "Done."
exit 0​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Make sure script completes without any errors. Otherwise remove Qlik Sense root CA certificate manually (please see &lt;A href="https://support.qlik.com/articles/000097192" target="_blank" rel="noopener"&gt;Recreating Qlik Sense root CA certificate (manual back-up and removal of existing certificates&lt;/A&gt;).&lt;/LI&gt;
&lt;LI&gt;Remove &lt;STRONG&gt;all current Qlik Sense certificates&lt;/STRONG&gt; from &lt;STRONG&gt;NON-CENTRAL NODES&lt;/STRONG&gt;&amp;nbsp;by executing the following PowerShell code:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

function RemoveCertificatesFromStore(
    [string] $name,
    [string] $location)
{
    $success = 1
    $oid = "1.3.6.1.5.5.7.13.3"

    $localStore = new-object System.Security.Cryptography.X509Certificates.X509Store $name, $location
    $localStore.Open("MaxAllowed")

    try
    {
        $certs = $localStore.Certificates
        foreach ($cert in $certs)
        {
            $extensions = $cert.Extensions
            foreach($extension in $extensions)
            {
                if ($extension.Oid.Value.Equals($oid))
                {
                    write-host "Deleting certificate from" $localStore.Name $localStore.Location
                    write-host " Subject:"$cert.Subject
                    write-host " Issuer:"$cert.Issuer
                    write-host " Serial:"$cert.SerialNumber
                    $localStore.Remove($cert)
                    break;
                }
            }
        }
    }

    catch
    {
        write-host "An error occurred while removing certificates" -ForegroundColor Red
        write-host $_.Exception.GetType().FullName -ForegroundColor Red
        write-host $_.Exception.Message -ForegroundColor Red
        $success = 0
    }

    finally
    {
        $localStore.Close()
    }

    if ($success -ne 1)
    {
        exit 20
    }
}

function CleanCertificates()
{
    RemoveCertificatesFromStore "Root" "LocalMachine"
    RemoveCertificatesFromStore "My" "LocalMachine"
    RemoveCertificatesFromStore "My" "CurrentUser"
}

CleanCertificates
write-host "Done."
exit 0​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Make sure script completes without any errors. Otherwise remove certificates manually (please see &lt;A href="https://support.qlik.com/articles/000097192" target="_blank" rel="noopener"&gt;Recreating Qlik Sense root CA certificate (manual back-up and removal of existing certificates&lt;/A&gt;).&lt;/LI&gt;
&lt;LI&gt;Remove &lt;STRONG&gt;all current Qlik Sense certificates&lt;/STRONG&gt; from &lt;STRONG&gt;NON-CENTRAL NODES&lt;/STRONG&gt; stored locally by deleting all files from following location:&lt;BR /&gt;&lt;BR /&gt;C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\.Local Certificates&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;On &lt;STRONG&gt;ALL NODES&lt;/STRONG&gt; navigate to C:\Program Files\Qlik\Sense\Repository (or corresponding nondefault location) and open Repository.exe.config file.&lt;/LI&gt;
&lt;LI&gt;Make sure &lt;STRONG&gt;Certificates.SelfSignedRoot.BasicConstraintsCA key&lt;/STRONG&gt; has value set to&lt;STRONG&gt; true&lt;/STRONG&gt;, in example:&lt;BR /&gt;&lt;BR /&gt;&amp;lt;add key="Certificates.SelfSignedRoot.BasicConstraintsCA" value="true" /&amp;gt;&lt;BR /&gt;&lt;BR /&gt;If the above key is not present, add it within &amp;lt;appSettings&amp;gt; section, in example:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;(…)
&amp;lt;add key="BackgroundWork.CountLimit" value="3" /&amp;gt;
&amp;lt;add key="Certificates.SelfSignedRoot.BasicConstraintsCA" value="true" /&amp;gt;
&amp;lt;add key="DatabaseCommandTimeout" value="00:01:30" /&amp;gt;
(…)​&lt;/LI-CODE&gt;&lt;BR /&gt;&lt;STRONG style="font-family: inherit;"&gt;NOTE:&lt;/STRONG&gt;&lt;SPAN&gt; If you are installing a patch on November 2018 track, name of the key is: &lt;FONT face="courier new,courier"&gt;&amp;lt;add key="CertificatesSelfSignedRootBasicConstraintsCA" value="true" /&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;On the &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt;, start &lt;STRONG&gt;Qlik Sense Repository Database service&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;On &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt;, from an elevated command line navigate to C:\Program Files\Qlik\Sense\Repository (or corresponding nondefault location) and run:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;repository.exe -bootstrap -iscentral​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;When bootstrap mode has reached Entering main startup phase.., start &lt;STRONG&gt;Qlik Sense Service Dispatcher service&lt;/STRONG&gt; and make sure that the Bootstrap mode has terminated. Press ENTER to exit.. final message is shown&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Note: &lt;/STRONG&gt;If this message is not shown, open Windows Task Manager, find Qlik Sense Repository Service in the Processes tab and end it by right-clicking on it and selecting End task.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;To make sure new certificate is in use, run the &lt;A href="https://github.com/StevenJDH/C2-Validator/releases" target="_blank" rel="noopener"&gt;C2 Validator tool&lt;/A&gt;,&lt;/LI&gt;
&lt;LI&gt;On &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt; restart &lt;STRONG&gt;Qlik Sense Service Dispatcher&lt;/STRONG&gt; and &lt;STRONG&gt;start all remaining services&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;On the &lt;STRONG&gt;NON-CENTRAL NODES&lt;/STRONG&gt;, depending on the setup, perform either step a) or b) below:
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Account running the Qlik Sense services has administrator privileges:
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;&lt;STRONG&gt;[Applicable ONLY for April 2019 track]&lt;/STRONG&gt;:&amp;nbsp;Delete host.cfg file from C:\ProgramData\Qlik\Sense\&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Start &lt;STRONG&gt;Qlik Sense Repository Service&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;Open the &lt;STRONG&gt;Qlik Management Console (QMC)&lt;/STRONG&gt; and &lt;STRONG&gt;redistribute the certificates&lt;/STRONG&gt; according to &lt;A href="https://help.qlik.com/en-US/sense-admin/Subsystems/DeployAdministerQSE/Content/Sense_DeployAdminister/QSEoW/Administer_QSEoW/Managing_QSEoW/redistribute-certificate.htm" target="_blank" rel="noopener"&gt;Redistributing a certificate&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Restart &lt;STRONG&gt;Qlik Sense Repository Service&lt;/STRONG&gt; and &lt;STRONG&gt;start all remaining services on the node&lt;/STRONG&gt; to make sure they are using the newly distributed certificates.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;Account running the Qlik Sense service does not have administrator privileges:
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;&lt;STRONG&gt;[Applicable ONLY for April 2019 track]&lt;/STRONG&gt;:&amp;nbsp;Delete host.cfg file from C:\ProgramData\Qlik\Sense\&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;At the command line, navigate to C:\Program Files\Qlik\Sense\Repository (or corresponding nondefault location), and run:&lt;BR /&gt;repository.exe -bootstrap&lt;/LI&gt;
&lt;LI&gt;When the Waiting for certificates to be installed.. message is displayed, redistribute the certificates according to &lt;A href="https://help.qlik.com/en-US/sense/June2019/Subsystems/ManagementConsole/Content/Sense_QMC/redistribute-certificate.htm" target="_blank" rel="noopener"&gt;Redistributing a certificate&lt;/A&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Once the bootstrap mode has terminated, start the &lt;STRONG&gt;Qlik Sense Service Dispatcher&lt;/STRONG&gt;, then start the&lt;STRONG&gt; Qlik Sense Repository Service&lt;/STRONG&gt;, and finally the r&lt;STRONG&gt;emaining Qlik Sense services&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Mon, 08 Jul 2024 09:50:12 GMT</pubDate>
    <dc:creator>Andrew_Delaney</dc:creator>
    <dc:date>2024-07-08T09:50:12Z</dc:date>
    <item>
      <title>Recreating Qlik Sense root CA certificate when upgrading to June 2019 and above (script based back-up and removal of existing certificates)</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/ta-p/1712696</link>
      <description>&lt;BLOCKQUOTE class="quote"&gt;The following steps are only applicable to Qlik Sense deployments originally installed with versions&lt;STRONG&gt; prior to the June 2019 release&lt;/STRONG&gt;. For any Qlik Sense deployments installed with later versions, follow standard steps for patching Qlik Sense and do not perform the steps in this article.&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In these steps we will occasionally ask you to run Powershell code.&lt;/P&gt;
&lt;P&gt;Executing PowerShell code:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Copy the code and save it in a ps1 file, in example: certificates_backup.ps1&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Open elevated command line and navigate to the location where the script was saved.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Start PowerShell by executing following command: Powershell&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Run the script by executing following command: .\&amp;lt;name_of_the_script&amp;gt;.ps1 in example: .\certificates_backup.ps1&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Environment&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Qlik Sense Enterprise on Windows, June 2019 thru November 2019&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;After upgrading to June 2019 or above, check the Root certificate by running the &lt;A href="https://github.com/StevenJDH/C2-Validator/releases" target="_blank" rel="noopener"&gt;C2 Validator&lt;/A&gt;&amp;nbsp;tool on&lt;STRONG&gt;&amp;nbsp;ALL NODES&lt;/STRONG&gt;. If CA and Critical&amp;nbsp;display 'Missing', please follow the instructions below.&lt;/LI&gt;
&lt;LI&gt;Stop &lt;STRONG&gt;all services&lt;/STRONG&gt; on &lt;STRONG&gt;ALL NODES&lt;/STRONG&gt; in the Qlik Sense cluster.&lt;/LI&gt;
&lt;LI&gt;Back up &lt;STRONG&gt;all current Qlik Sense certificates&lt;/STRONG&gt; from the &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt; by executing the following PowerShell code:&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

function ExportCertificatesFromStore(
    [string] $name,
    [string] $location)
{
    $success = 1
    $oid = "1.3.6.1.5.5.7.13.3"
    
    $localStore = new-object System.Security.Cryptography.X509Certificates.X509Store $name, $location
    $localStore.Open("MaxAllowed")

    $mypwd = ConvertTo-SecureString -String "MyPassword" -Force -AsPlainText

    try
    {
        $certs = $localStore.Certificates
        foreach ($cert in $certs)
        {
            $extensions = $cert.Extensions
            foreach($extension in $extensions)
            {
                if ($extension.Oid.Value.Equals($oid))
                {
                    Get-ChildItem -Path cert:\$($localStore.Location)\$($localStore.Name) | Where-Object { $_.PrivateKey.CspKeyContainerInfo.Exportable } | Export-PfxCertificate -FilePath "$($localStore.Name)_$($localStore.Location).pfx" -Password $mypwd
                    break;
                }
            }
        }
    }

    catch
    {
        write-host "An error occurred while removing certificates" -ForegroundColor Red
        write-host $_.Exception.GetType().FullName -ForegroundColor Red
        write-host $_.Exception.Message -ForegroundColor Red
        $success = 0
    }

    finally
    {
        $localStore.Close()
    }
    
    if ($success -ne 1)
    {
        exit 20
    }
}

function ExportCertificates()
{
    ExportCertificatesFromStore "Root" "LocalMachine"
    ExportCertificatesFromStore "My" "LocalMachine"
    ExportCertificatesFromStore "My" "CurrentUser"
}

ExportCertificates
write-host "Done."
exit 0&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; For information on how to execute above code please refer to “Executing PowerShell code” section at the top. Modify $mypwd variable to define custom password. Make sure certificates were backed up after running the script:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Root_LocalMachine.pfx – root CA&lt;/LI&gt;
&lt;LI&gt;My_LocalMachine.pfx – server&lt;/LI&gt;
&lt;LI&gt;My_CurrentUser – client&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; If you happen to have more certificates with the same values in Issued To, Issued By and Friendly Name columns and you are unable to identify the correct certificate, please refer to&amp;nbsp;&lt;A href="https://support.qlik.com/articles/000098419" target="_blank" rel="noopener"&gt;Identifying Qlik Sense root CA and server certificates in certificate store&lt;/A&gt;.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Remove &lt;STRONG&gt;current Qlik Sense root CA certificate &lt;/STRONG&gt;from &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt; by executing the following PowerShell code:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

function RemoveCertificatesFromStore(
[string] $name,
[string] $location)
{
    $success = 1
    $oid = "1.3.6.1.5.5.7.13.3"

    $localStore = new-object System.Security.Cryptography.X509Certificates.X509Store $name, $location
    $localStore.Open("MaxAllowed")
    try
    {
        $certs = $localStore.Certificates
        foreach ($cert in $certs)
        {
            $extensions = $cert.Extensions
            foreach($extension in $extensions)
            {
                if ($extension.Oid.Value.Equals($oid))
                {
                    write-host "Deleting certificate from" $localStore.Name $localStore.Location
                    write-host " Subject:"$cert.Subject
                    write-host " Issuer:"$cert.Issuer
                    write-host " Serial:"$cert.SerialNumber
                    $localStore.Remove($cert)
                    break;
                }
            }
        }
    }
    catch
    {
        write-host "An error occurred while removing certificates" -ForegroundColor Red
        write-host $_.Exception.GetType().FullName -ForegroundColor Red
        write-host $_.Exception.Message -ForegroundColor Red
        $success = 0
    }
    finally
    {
        $localStore.Close()
    }

    if ($success -ne 1)
    {
        exit 20
    }
}

function CleanCertificates()
{
    RemoveCertificatesFromStore "Root" "LocalMachine"
}

CleanCertificates
write-host "Done."
exit 0​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Make sure script completes without any errors. Otherwise remove Qlik Sense root CA certificate manually (please see &lt;A href="https://support.qlik.com/articles/000097192" target="_blank" rel="noopener"&gt;Recreating Qlik Sense root CA certificate (manual back-up and removal of existing certificates&lt;/A&gt;).&lt;/LI&gt;
&lt;LI&gt;Remove &lt;STRONG&gt;all current Qlik Sense certificates&lt;/STRONG&gt; from &lt;STRONG&gt;NON-CENTRAL NODES&lt;/STRONG&gt;&amp;nbsp;by executing the following PowerShell code:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

function RemoveCertificatesFromStore(
    [string] $name,
    [string] $location)
{
    $success = 1
    $oid = "1.3.6.1.5.5.7.13.3"

    $localStore = new-object System.Security.Cryptography.X509Certificates.X509Store $name, $location
    $localStore.Open("MaxAllowed")

    try
    {
        $certs = $localStore.Certificates
        foreach ($cert in $certs)
        {
            $extensions = $cert.Extensions
            foreach($extension in $extensions)
            {
                if ($extension.Oid.Value.Equals($oid))
                {
                    write-host "Deleting certificate from" $localStore.Name $localStore.Location
                    write-host " Subject:"$cert.Subject
                    write-host " Issuer:"$cert.Issuer
                    write-host " Serial:"$cert.SerialNumber
                    $localStore.Remove($cert)
                    break;
                }
            }
        }
    }

    catch
    {
        write-host "An error occurred while removing certificates" -ForegroundColor Red
        write-host $_.Exception.GetType().FullName -ForegroundColor Red
        write-host $_.Exception.Message -ForegroundColor Red
        $success = 0
    }

    finally
    {
        $localStore.Close()
    }

    if ($success -ne 1)
    {
        exit 20
    }
}

function CleanCertificates()
{
    RemoveCertificatesFromStore "Root" "LocalMachine"
    RemoveCertificatesFromStore "My" "LocalMachine"
    RemoveCertificatesFromStore "My" "CurrentUser"
}

CleanCertificates
write-host "Done."
exit 0​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Make sure script completes without any errors. Otherwise remove certificates manually (please see &lt;A href="https://support.qlik.com/articles/000097192" target="_blank" rel="noopener"&gt;Recreating Qlik Sense root CA certificate (manual back-up and removal of existing certificates&lt;/A&gt;).&lt;/LI&gt;
&lt;LI&gt;Remove &lt;STRONG&gt;all current Qlik Sense certificates&lt;/STRONG&gt; from &lt;STRONG&gt;NON-CENTRAL NODES&lt;/STRONG&gt; stored locally by deleting all files from following location:&lt;BR /&gt;&lt;BR /&gt;C:\ProgramData\Qlik\Sense\Repository\Exported Certificates\.Local Certificates&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;On &lt;STRONG&gt;ALL NODES&lt;/STRONG&gt; navigate to C:\Program Files\Qlik\Sense\Repository (or corresponding nondefault location) and open Repository.exe.config file.&lt;/LI&gt;
&lt;LI&gt;Make sure &lt;STRONG&gt;Certificates.SelfSignedRoot.BasicConstraintsCA key&lt;/STRONG&gt; has value set to&lt;STRONG&gt; true&lt;/STRONG&gt;, in example:&lt;BR /&gt;&lt;BR /&gt;&amp;lt;add key="Certificates.SelfSignedRoot.BasicConstraintsCA" value="true" /&amp;gt;&lt;BR /&gt;&lt;BR /&gt;If the above key is not present, add it within &amp;lt;appSettings&amp;gt; section, in example:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;(…)
&amp;lt;add key="BackgroundWork.CountLimit" value="3" /&amp;gt;
&amp;lt;add key="Certificates.SelfSignedRoot.BasicConstraintsCA" value="true" /&amp;gt;
&amp;lt;add key="DatabaseCommandTimeout" value="00:01:30" /&amp;gt;
(…)​&lt;/LI-CODE&gt;&lt;BR /&gt;&lt;STRONG style="font-family: inherit;"&gt;NOTE:&lt;/STRONG&gt;&lt;SPAN&gt; If you are installing a patch on November 2018 track, name of the key is: &lt;FONT face="courier new,courier"&gt;&amp;lt;add key="CertificatesSelfSignedRootBasicConstraintsCA" value="true" /&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;On the &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt;, start &lt;STRONG&gt;Qlik Sense Repository Database service&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;On &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt;, from an elevated command line navigate to C:\Program Files\Qlik\Sense\Repository (or corresponding nondefault location) and run:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;repository.exe -bootstrap -iscentral​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;When bootstrap mode has reached Entering main startup phase.., start &lt;STRONG&gt;Qlik Sense Service Dispatcher service&lt;/STRONG&gt; and make sure that the Bootstrap mode has terminated. Press ENTER to exit.. final message is shown&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;Note: &lt;/STRONG&gt;If this message is not shown, open Windows Task Manager, find Qlik Sense Repository Service in the Processes tab and end it by right-clicking on it and selecting End task.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;To make sure new certificate is in use, run the &lt;A href="https://github.com/StevenJDH/C2-Validator/releases" target="_blank" rel="noopener"&gt;C2 Validator tool&lt;/A&gt;,&lt;/LI&gt;
&lt;LI&gt;On &lt;STRONG&gt;CENTRAL NODE&lt;/STRONG&gt; restart &lt;STRONG&gt;Qlik Sense Service Dispatcher&lt;/STRONG&gt; and &lt;STRONG&gt;start all remaining services&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;On the &lt;STRONG&gt;NON-CENTRAL NODES&lt;/STRONG&gt;, depending on the setup, perform either step a) or b) below:
&lt;UL class="lia-list-style-type-circle"&gt;
&lt;LI&gt;Account running the Qlik Sense services has administrator privileges:
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;&lt;STRONG&gt;[Applicable ONLY for April 2019 track]&lt;/STRONG&gt;:&amp;nbsp;Delete host.cfg file from C:\ProgramData\Qlik\Sense\&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Start &lt;STRONG&gt;Qlik Sense Repository Service&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;LI&gt;Open the &lt;STRONG&gt;Qlik Management Console (QMC)&lt;/STRONG&gt; and &lt;STRONG&gt;redistribute the certificates&lt;/STRONG&gt; according to &lt;A href="https://help.qlik.com/en-US/sense-admin/Subsystems/DeployAdministerQSE/Content/Sense_DeployAdminister/QSEoW/Administer_QSEoW/Managing_QSEoW/redistribute-certificate.htm" target="_blank" rel="noopener"&gt;Redistributing a certificate&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Restart &lt;STRONG&gt;Qlik Sense Repository Service&lt;/STRONG&gt; and &lt;STRONG&gt;start all remaining services on the node&lt;/STRONG&gt; to make sure they are using the newly distributed certificates.&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;Account running the Qlik Sense service does not have administrator privileges:
&lt;OL class="lia-list-style-type-lower-alpha"&gt;
&lt;LI&gt;&lt;STRONG&gt;[Applicable ONLY for April 2019 track]&lt;/STRONG&gt;:&amp;nbsp;Delete host.cfg file from C:\ProgramData\Qlik\Sense\&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;At the command line, navigate to C:\Program Files\Qlik\Sense\Repository (or corresponding nondefault location), and run:&lt;BR /&gt;repository.exe -bootstrap&lt;/LI&gt;
&lt;LI&gt;When the Waiting for certificates to be installed.. message is displayed, redistribute the certificates according to &lt;A href="https://help.qlik.com/en-US/sense/June2019/Subsystems/ManagementConsole/Content/Sense_QMC/redistribute-certificate.htm" target="_blank" rel="noopener"&gt;Redistributing a certificate&lt;/A&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;Once the bootstrap mode has terminated, start the &lt;STRONG&gt;Qlik Sense Service Dispatcher&lt;/STRONG&gt;, then start the&lt;STRONG&gt; Qlik Sense Repository Service&lt;/STRONG&gt;, and finally the r&lt;STRONG&gt;emaining Qlik Sense services&lt;/STRONG&gt;.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 08 Jul 2024 09:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/ta-p/1712696</guid>
      <dc:creator>Andrew_Delaney</dc:creator>
      <dc:date>2024-07-08T09:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Recreating Qlik Sense root CA certificate when upgrading to June 2019 and above (script based ba</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/tac-p/1744747#M758</link>
      <description>&lt;P&gt;can you confirm some of the issues that this certificate problem are known to cause?&amp;nbsp;&lt;BR /&gt;what are some of the symptoms that the system will exhibit when this issue is present?&lt;/P&gt;&lt;P&gt;thanks - Ken&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 12:55:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/tac-p/1744747#M758</guid>
      <dc:creator>ken4runner</dc:creator>
      <dc:date>2020-09-17T12:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Recreating Qlik Sense root CA certificate when upgrading to June 2019 and above (script based back-up and removal of existing certificates)</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/tac-p/2499986#M15195</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28597"&gt;@Sonja_Bauernfeind&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Is it possible to replace the Qlik generated certificates mentioned here(&lt;A href="https://help.qlik.com/en-US/sense-admin/November2024/Subsystems/DeployAdministerQSE/Content/Sense_DeployAdminister/QSEoW/Deploy_QSEoW/Backing-up-certificates.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense-admin/November2024/Subsystems/DeployAdministerQSE/Content/Sense_DeployAdminister/QSEoW/Deploy_QSEoW/Backing-up-certificates.htm&lt;/A&gt; ) by the third party trusted certificates.&lt;/P&gt;
&lt;P&gt;Our cybersecurity team has flagged the Qlik generated certificates as the expiry date is more than 2 years and also those are self signed certificates and must be replaced by the trusted non self signed certificates.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 14:52:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/tac-p/2499986#M15195</guid>
      <dc:creator>AkashPohare_HB</dc:creator>
      <dc:date>2025-01-04T14:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Recreating Qlik Sense root CA certificate when upgrading to June 2019 and above (script based back-up and removal of existing certificates)</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/tac-p/2500197#M15200</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/301286"&gt;@AkashPohare_HB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They cannot be replaced as they are needed for service communication. You can &lt;A href="https://community.qlik.com/t5/Official-Support-Articles/How-to-change-the-certificate-used-by-the-Qlik-Sense-Proxy-to-a/ta-p/1712773" target="_blank" rel="noopener"&gt;replace the certificate used in the front&lt;/A&gt; end (the certificate the proxy uses for end-user access), but even then the original certificates must remain as they will still be used between the services.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recommend you raise an idea for this in &lt;A href="https://community.qlik.com/t5/Ideation/ct-p/qlik-product-insight" target="_blank" rel="noopener"&gt;our Ideation section&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;All the best,&lt;BR /&gt;Sonja&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 07:36:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/tac-p/2500197#M15200</guid>
      <dc:creator>Sonja_Bauernfeind</dc:creator>
      <dc:date>2025-01-07T07:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Recreating Qlik Sense root CA certificate when upgrading to June 2019 and above (script based back-up and removal of existing certificates)</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/tac-p/2500356#M15203</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28597"&gt;@Sonja_Bauernfeind&lt;/a&gt;&amp;nbsp; for the confirmation.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 10:31:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Recreating-Qlik-Sense-root-CA-certificate-when-upgrading-to-June/tac-p/2500356#M15203</guid>
      <dc:creator>AkashPohare_HB</dc:creator>
      <dc:date>2025-01-08T10:31:14Z</dc:date>
    </item>
  </channel>
</rss>

