Knowledgebase: PaperCut > Administration
Administering PaperCut with PowerShell
Last modified on 22 March 2016 10:41 AM

PaperCut has a number of supported methods for configuring PaperCut programmatically. These include using the server-command tool from the PaperCut Application Server, or calling this tool from remote machines. PaperCut can also be called programmatically via our APIs from a number of programming languages such as C#, Java and more.

It is also possible to configure PaperCut from PowerShell. PowerShell allows for the import of libraries into the PowerShell environment to extend its capabilities. Administrators can then take advantage of the advanced features of PowerShell (when compared to the traditional command line) including the easy maintenance of scripts.


PaperCut already ships with a ServerCommandProxy class for C#, which presents all available API calls as methods of a class. This class can be compiled as a library with relative ease, and imported into PowerShell for usage;

  1. Use Visual Studio to create a new Project of type Class Library with the name of ServerCommandProxy.
  2. Remove the default Class1.cs Visual Studio will have added to the project.
  3. Choose Add Existing Item and navigate to
    [install path]\server\examples\webservices\csharp\
    and add the ServerCommandProxy.cs file to the project
  4. Double click this file/class and wrap everything after the using CookComputing.XmlRpc line in a namespace called PaperCut
  5. Add a reference to the CookComputing.XmlRpcV2.dll library to the project. If you don’t have these libraries, you will need to download these from the XML-RPC website, found here:
    You’ll need to use something other than the Windows unzip method to find the libraries within, as they live in a folder the Windows archive tool doesn’t acknowledge.
  6. Compile the project to create your ServerCommandProxy.dll

From PowerShell, it’s now simply a case of importing these libraries to start configuring PaperCut from the shell.

  1. First, create a variable that saves the path the ServerCommandProxy.dll and CookComputing.XmlRpcV2.dll files live in. In my example this is;
    $libPath = C:\VS\ServerCommandProxy\bin\Debug
  2. Then, import the libraries into the environment;
    Add-Type -Path “$libPath\ServerCommandProxy.dll”
    Add-Type -Path “$libPath\CookComputing.XmlRpcV2.dll”
  3. Create a new instance of the ServerCommandProxy class;
    $s = New-Object PaperCut.ServerCommandProxy(“localhost”,9191,”password”);
  4. Finally, make your first call against the PaperCut server programmatically;