
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to recover or update the NPrinting repository database super user password
Mar 25, 2024 7:13:04 AM
Oct 13, 2017 7:42:57 PM
Company policy may sometimes include the need to change the NPrinting PostgreSQL repository database password.
Depending on the version of NPrinting deployed, different methods are used.
Content:
- Qlik NPrinting 19 to 20 and later
- How to recover the current NPrinting repository password
- Update the current NPrinting repository password
- Qlik NPrinting 17 and 18
- Part 1 - Database
- Part 2 - Qlik NPrinting
Qlik NPrinting 19 to 20 and later
For Qlik NPrting releases beginning with February 2019, follow the steps outlined below. Note that these steps are written for PowerShell. The scripts are attached in individual .zip files.
How to recover the current NPrinting repository password
Use the attached Powershell script named RecoverNPRepoPassword.ps1 or Open Windows Powershell ISE as an administrator on your NPrinting server and run the script manually.
Note that an error may be printed when attempting to run the ps1 file:
The file ......RecoverNPRepoPassword.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at
http://go.microsoft.com/fwlink/?LinkID=135170.
In this case, run the following first to temporarily set the execution policy to bypass for only the current PowerShell session after the window is closed.
The command is:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Click Yes on the popup window and proceed with running the provided script.
The Powershell ISE to run individually are:
$ConfigFile = "C:\Program Files\NPrintingServer\NPrinting\WebEngine\webengine.config"
Function Decrypt-WithMachineKey([Parameter(Mandatory = $True, ValueFromPipeline)]$input)
{
Add-Type -AssemblyName System.Security
$secured = [System.Convert]::FromBase64String($input)
$bytes = [Security.Cryptography.ProtectedData]::Unprotect($secured, $null, [Security.Cryptography.DataProtectionScope]::LocalMachine)
return [System.Text.Encoding]::UTF8.GetString($bytes)
}
[xml]$Xml = Get-Content $ConfigFile
$PGHost = $Xml.SelectSingleNode('//add[@key = "pg-host"]')
$PGPort = $Xml.SelectSingleNode('//add[@key = "pg-port"]')
$PGDB = $Xml.SelectSingleNode('//add[@key = "pg-database"]')
You should see the current password on your PowerShell window:
$PGUserName = $Xml.SelectSingleNode('//add[@key = "pg-username"]')
$PGPassword = $Xml.SelectSingleNode('//add[@key = "pg-password"]')
Write-host "Existing Repository Configuration:" -ForegroundColor Green
Write-host "$($PGUserName.value)@$($PGHost.value):$($PGPort.value)/$($PGDB.value)"
write-host "Password for $($PGUserName.value): " -NoNewline -ForegroundColor Gray
write-host "$($PGPassword.value|Decrypt-WithMachineKey)" -ForegroundColor Red
Update the current NPrinting repository password
If you do not know the old password, use UpdateNPRepoPassword.ps1 or open Windows Powershell ISE as an administrator on your NPrinting server and run:
$NewPassword = "NewPasswordValueHere"
$ConfigFile = "C:\Program Files\NPrintingServer\NPrinting\WebEngine\webengine.config"
Function Encrypt-WithMachineKey([Parameter(Mandatory = $True, ValueFromPipeline)]$input)
{
Add-Type -AssemblyName System.Security
$bytes = [System.Text.Encoding]::UTF8.GetBytes($input)
$secured = [Security.Cryptography.ProtectedData]::Protect($bytes, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser)
return [System.Convert]::ToBase64String($secured)
}
[xml]$Xml = Get-Content $ConfigFile
$PGPassword = $Xml.SelectSingleNode('//add[@key = "pg-password"]')
$NewEnvPassword = $NewPassword|Encrypt-WithMachineKey
$PGPassword.value = $NewEnvPassword
$XML.Save($ConfigFile)
If you know the old password, use UpdateOldNPRepoPassword.ps1 or open Windows Powershell ISE as an administrator on your NPrinting server and run:
$NewPassword = "NewPasswordValueHere"
$ConfigFile = "C:\Program Files\NPrintingServer\NPrinting\WebEngine\webengine.config"
Function Encrypt-WithMachineKey([Parameter(Mandatory = $True, ValueFromPipeline)]$input)
{
Add-Type -AssemblyName System.Security
$bytes = [System.Text.Encoding]::UTF8.GetBytes($input)
$secured = [Security.Cryptography.ProtectedData]::Protect($bytes, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser)
return [System.Convert]::ToBase64String($secured)
}
Function Decrypt-WithMachineKey([Parameter(Mandatory = $True, ValueFromPipeline)]$input)
{
Add-Type -AssemblyName System.Security
$secured = [System.Convert]::FromBase64String($input)
$bytes = [Security.Cryptography.ProtectedData]::Unprotect($secured, $null, [Security.Cryptography.DataProtectionScope]::LocalMachine)
return [System.Text.Encoding]::UTF8.GetString($bytes)
}
[xml]$Xml = Get-Content $ConfigFile
$PGUserName = $Xml.SelectSingleNode('//add[@key = "pg-username"]')
$PGPassword = $Xml.SelectSingleNode('//add[@key = "pg-password"]')
write-host "Previous Password for $($PGUserName.value): " -NoNewline -ForegroundColor Gray
write-host "$($PGPassword.value|Decrypt-WithMachineKey)" -ForegroundColor Red
$NewEnvPassword = $NewPassword|Encrypt-WithMachineKey
$PGPassword.value = $NewEnvPassword
$XML.Save($ConfigFile)
Qlik NPrinting 17 and 18
As best practice, first take a backup of the database: How to BackUp and Restore Qlik NPrinting Repository Database from End to End
Part 1 - Database
- Open Windows Services.msc and stop all NPrinting services except QlikNprintnigRepoService
- Browse to folder C:\Program Files\NPrintingServer\pgsql\bin and launch pgAdmin3.exe.
- For Nprinting 18 go to C:\Program Files\NPrintingServer\pgsql\pgAdmin 4\bin and launch pgamdmin4.exe
- Click Add a connection to a server
- Use the following details in New Server Registration
Name: Nprinting
Server: localhost
Port: 4992
Maintenance DB: postgres (select from pull down)
Username: postgres
Password: The password that you entered during installation - Once connected, select Nprinting then go to File > Change Password...
-
Enter your old password and new password (x2) as requested
Part 2 - Qlik NPrinting
- Open Windows Services.msc and stop the QlikNprintnigRepoService as well
- Update the "pg-password" key value stored in these 2 config files to the new password:
C:\Program Files\NPrintingServer\NPrinting\WebEngine\webengine.config
C:\Program Files\NPrintingServer\NPrinting\Scheduler\scheduler.config - Start all NPrinting services


- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
UAU alias WOW!


- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I think you miss some info.
When we update NP repo password we are need to update 3 files
C:\Program Files\NPrintingServer\NPrinting\WebEngine\webengine.config
C:\Program Files\NPrintingServer\NPrinting\Scheduler\scheduler.config
c:\Program Files\NPrintingServer\NPrinting\Audit\audit.config
but all scripts contain only webengine.config file update.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content