Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Gin009
Contributor III
Contributor III

How to Backup NPrinting with Invoke-Command

Hi guys, 

   I want to write the backup nprinting command in the powershell automation script. I need to use the Invoke-Command command. How should I implement it? Here is the command to install NPrinting using Invoke-Command:

Invoke-Command -ScriptBlock {Start-Process -FilePath "C:\QlikNPrintingServer_x64.exe" -Verb RunAs -ArgumentList "/install /passive accept-eula=1 admin-username=$user admin-password=12345678 admin-email=npadmin@email.com service-username=$hostname\$user service-password=$qPwd database-password=12345678 /log C:\server.log" -Wait -PassThru}

  Thanks!!

Labels (1)
2 Solutions

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

I dont know anything about "Invoke-Commands" so I can only relate to batch scripts currently available and working and supported...

All I know is that NPrinting backup needs to run command: 

"C:\Program Files\NPrintingServer\Tools\Manager\Qlik.Nprinting.Manager.exe" with parameters. I am attaching batch file which I typically schedule to run locally on NPrinting machine. There are parameters you need to provide in it but those are straight forward.
cheers
 
cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

Ruggero_Piccoli
Support
Support

Hi,

The following PowerShell script worked in my installation:

$remoteComputerName = "ServerName"

$backupCommand = {
    # Change directory to the NPrinting Manager folder
    cd "C:\Program Files\NPrintingServer\Tools\Manager\"

    # Execute the backup command
    .\Qlik.Nprinting.Manager.exe backup -f C:\NPrintingBackups\NP_Backup.zip
}

Invoke-Command -ComputerName $remoteComputerName -ScriptBlock {
    param($backupCommand)
    Invoke-Expression $backupCommand
} -ArgumentList $backupCommand

I supply this code as an example without any warranty it will work in your server. I suggest to create a Qlik NPrinting backup and stere it in a safe place before testing the script.  

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.

View solution in original post

6 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

I dont know anything about "Invoke-Commands" so I can only relate to batch scripts currently available and working and supported...

All I know is that NPrinting backup needs to run command: 

"C:\Program Files\NPrintingServer\Tools\Manager\Qlik.Nprinting.Manager.exe" with parameters. I am attaching batch file which I typically schedule to run locally on NPrinting machine. There are parameters you need to provide in it but those are straight forward.
cheers
 
cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Frank_S
Support
Support

Hi @Gin009 
First you do not need a password for current supported versions of NPrinting.

Also I recommend that you use the available default supported backup scripting. 

 

For this and other backup and restore information see:

How to BackUp and Restore Qlik NPrinting Repositor... - Qlik Community - 1715863

 

Kind regards...

Please remember hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Ruggero_Piccoli
Support
Support

Hi,

The following PowerShell script worked in my installation:

$remoteComputerName = "ServerName"

$backupCommand = {
    # Change directory to the NPrinting Manager folder
    cd "C:\Program Files\NPrintingServer\Tools\Manager\"

    # Execute the backup command
    .\Qlik.Nprinting.Manager.exe backup -f C:\NPrintingBackups\NP_Backup.zip
}

Invoke-Command -ComputerName $remoteComputerName -ScriptBlock {
    param($backupCommand)
    Invoke-Expression $backupCommand
} -ArgumentList $backupCommand

I supply this code as an example without any warranty it will work in your server. I suggest to create a Qlik NPrinting backup and stere it in a safe place before testing the script.  

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Gin009
Contributor III
Contributor III
Author

Hi @Ruggero_Piccoli 

  it work

  Thanks!!

Gin009
Contributor III
Contributor III
Author

Hi @Frank_S 

   Thanks for your support, a solution has been found

Gin009
Contributor III
Contributor III
Author

Hi @Lech_Miszkiewicz 

   Thanks for your support, a solution has been found