Calling server-command from a remote system

KB Home   |   Calling server-command from a remote system

Main.CallingServerCommandRemotely History

Hide minor edits - Show changes to output

June 02, 2017, at 12:38 AM by Alec - user "~" to represent papercut home directory -- should always work no matter where product is
Changed line 29 from:
   ssh papercut@papercutserver "/home/papercut/server/bin/linux-x64/server-command disable-printer printsrv1 labprinter -1"
to:
   ssh papercut@papercutserver "~/server/bin/linux-x64/server-command disable-printer printsrv1 labprinter -1"
May 09, 2017, at 04:18 AM by peterf - Modifying to remove reference to 32-bit Linux binaries.
Changed line 29 from:
   ssh papercut@papercutserver "/home/papercut/server/bin/linux-i686/server-command disable-printer printsrv1 labprinter -1"
to:
   ssh papercut@papercutserver "/home/papercut/server/bin/linux-x64/server-command disable-printer printsrv1 labprinter -1"
June 19, 2015, at 02:09 AM by 203.222.91.204 -
Changed line 4 from:
* allocated extra [[https://www.papercut.com/|print quota]] to user accounts
to:
* allocated extra [[https://www.papercut.com/tour/print-quotas/|print quota]] to user accounts
Changed line 15 from:
!!Windows:
to:
!!Windows (Any):
Added lines 20-25:
!!Windows 2008 R2:
Use [[http://msdn.microsoft.com/en-us/library/windows/desktop/aa384291(v=vs.85).aspx|Windows Remote Management Services]]. An example:

    winrs -r:[servername] -nop -d:"C:\Program Files (x86)\PaperCut NG\server\bin\win\" server-command.exe rename-user "<old_username>" "<new_username>"

Changed line 34 from:
''Categories:'' [[Category.Scripting|+]]
to:
''Categories:'' [[Category.Scripting|+]]
Changed lines 13-14 from:
[@server-command@] is a local program and must be run directly on the PaperCut server.  The server command may however be called remotely using standard ''remote command'' tools.  Options include:
to:
[@server-command@] is a local program and must be run directly on the PaperCut server as a privileged user (for security reasons).  The server command may however be called remotely using standard ''remote command'' tools.  Options include:
Changed lines 21-22 from:
Use [[http://en.wikipedia.org/wiki/Secure_Shell|SSH]] - a secure remote command/shell program.  SSH can be run non-interactively in scripts with the use of an authorized public key added under the ''papercut'' account's [@~/.ssh/authorized_keys@] list..
to:
Use [[http://en.wikipedia.org/wiki/Secure_Shell|SSH]] - a secure remote command/shell program.  SSH can be run non-interactively in scripts with the use of an authorized public key added under the ''papercut'' account's [@~/.ssh/authorized_keys@] list.  Example use:
Changed lines 21-22 from:
Use [[http://en.wikipedia.org/wiki/Secure_Shell|SSH]] - a secure remote command/shell program.  SSH can be run non-interactively in scripts with the use of an authorized public key added under the ''papercut'' account's authorized keys list..
to:
Use [[http://en.wikipedia.org/wiki/Secure_Shell|SSH]] - a secure remote command/shell program.  SSH can be run non-interactively in scripts with the use of an authorized public key added under the ''papercut'' account's [@~/.ssh/authorized_keys@] list..
Changed lines 13-14 from:
[@server-command@] is a local program and must be run directly on this server.  You can call server command from a remote server however using standard remote command tools.  Options include:
to:
[@server-command@] is a local program and must be run directly on the PaperCut server.  The server command may however be called remotely using standard ''remote command'' tools.  Options include:
Changed line 28 from:
''Categories:'' [[Category.Printers|+]], [[Category.Scripting|+]]
to:
''Categories:'' [[Category.Scripting|+]]
Changed line 4 from:
* allocated extra print quota to user accounts
to:
* allocated extra [[https://www.papercut.com/|print quota]] to user accounts
Changed line 6 from:
* scheduling backups
to:
* scheduling/starting backups
Changed lines 9-10 from:
It's often used by administrators in simple scripts such as batch files, shell scripts, or via languages such as VBScript, Python, Perl or Ruby.  You can read more about this here:
to:
It's often used by administrators in simple scripts such as batch files, shell scripts, or via languages such as `VBScript, Python, Perl or Ruby.  You can read more about this here:
Added lines 25-28:


----
''Categories:'' [[Category.Printers|+]], [[Category.Scripting|+]]
Changed lines 4-8 from:
 * allocated extra print quota to user accounts
 * changing user settings
 * scheduling backups
 * creating new accounts on demand
to:
* allocated extra print quota to user accounts
* changing user settings
* scheduling backups
* creating new accounts on demand
Changed lines 16-17 from:
Use psexec.exe - a remote command program provided by the SysInternals team at Microsoft.
to:
Use [[http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx|psexec.exe]] - a remote command program provided by the Sysinternals team at Microsoft.  Example use:

    psexec.exe \\papercutserver "c:\Program Files\PaperCut NG\server\bin\win\server-command.exe" disable-printer printsrv1 labprinter -1

!!Linux/Novell/Mac:
Use [[http://en.wikipedia.org/wiki/Secure_Shell|SSH]] - a secure remote command/shell program.  SSH can be run non-interactively in scripts with the use of an authorized public key added under the ''papercut'' account's authorized keys list..

    ssh papercut@papercutserver "/home/papercut/server/bin/linux-i686/server-command disable-printer printsrv1 labprinter -1"

Added lines 1-17:
(:title Calling server-command from a remote system :)

The scripting tool provided with PaperCut called [@server-command@] is a very powerful utility that provides access to dozens of scripting server operations ranging from:
 * allocated extra print quota to user accounts
 * changing user settings
 * scheduling backups
 * creating new accounts on demand

It's often used by administrators in simple scripts such as batch files, shell scripts, or via languages such as VBScript, Python, Perl or Ruby.  You can read more about this here:

->https://www.papercut.com/products/ng/manual/apdx-tools.html

[@server-command@] is a local program and must be run directly on this server.  You can call server command from a remote server however using standard remote command tools.  Options include:

!!Windows:
Use psexec.exe - a remote command program provided by the SysInternals team at Microsoft.

Comments

Share your findings and experience with other PaperCut users. Feel free to add comments and suggestions about this Knowledge Base article. Please don't use this for support requests.

Article last modified on June 02, 2017, at 12:38 AM
Printable View   |   Article History   |   Edit Article