Latest posts by Sander Berkouwer (see all)
- Review: Softerra Adaxes - Automating Active Directory management - Thu, Jun 4 2015
- Azure Multi-Factor Authentication - Part 8: Delegating Administration - Tue, Apr 28 2015
- Azure Multi-Factor Authentication - Part 7: Securing AD FS - Thu, Apr 23 2015
The Print Server Server Role has been a part of Server Core installations since Windows Server 2008.
Print and Document Services Server Role in Server Core ^
In Server Core installations of Windows Server 2012, the Print and Document Services Server Role features four Role Services:
- Print Server
This is the core of every Windows Server 2012–based Print Server. When you install the Print and Document Services Server Role, this Role Service is installed by default.
- Distributed Scan Server
The Distributed Scan Server Role Service provides a central administration point for sharing and managing DSM-aware network scanners.
- Internet Printing
The Internet Printing service creates a website where users can manage print jobs on a Print Server. It also enables users who have the Internet Printing Client installed to use a web browser to connect and print to shared printers by using the Internet Printing Protocol (IPP).
- LPD Service
The Line Printer Daemon service enables UNIX-based computers or other computers using the Line Printer Remote (LPR) service to print to shared printers on a Windows Print Server.
How to install the Print and Document Services Server Role ^
Turning a Windows Server 2012–based Server Core installation into a Print Server is pretty easy. You’ll only need one PowerShell command:
Install Print Services
As mentioned previously, this installs the Print Server Role Service automatically too.
How to add printers to a Server Core Print Server ^
A Print Server without printers is likely to become a sad server, even when it’s a Server Core installation. It’s time to add some printers.
You can add printers in three ways in Windows Server 2012–based Server Core installations:
- Use the (old) Printing Admin scripts.
- Use the Print Server-related PowerShell cmdlets.
- Use the Graphical User Interface (GUI).
Using the (old) printing admin scripts
When the Print Server Role is installed, a special folder is created on your hard disk. This folder contains the (old) *.vbs-style Printing Admin scripts. The scripts are located in a subfolder with the installed language (most likely en-US) of the C:\Windows\System32\Printing_Admin_Scripts folder.
The following scripts are available:
It’s good to see these trusty old scripts on Windows Server 2012–based Server Core installations because this means you can reuse your current printer configuration scripts.
A line to add a printer port would look something like this:
cscript prnport.vbs -a -r 10.2.255.11 -h 10.2.255.11 -o raw
To add a printer on this printer port, you could use a line that looks like:
cscript prnmngr.vbs -a -p PRT-Location1-HRM -m "Xerox Global Print Driver PS" -r 10.2.255.11
After you’ve created the printer, you can share it:
cscript prncnfg.vbs -t -p PRT-Location1-HRM -r 10.2.255.11 -h PRT-Location1-HRM +shared -direct -m "Default printer for HR" -l "Location 1"
When the Print Server is a member of an Active Directory domain, you might also want to publish the printer in Active Directory. This is done with the following command:
cscript pubprn.vbs \\SC2\PRT-Location1-HRM "LDAP://CN=MyContainer,DC=Domain,DC=tld"
The *.vbs-style commands are pretty short, but they are not very human-readable.
Using the Print Server-related PowerShell cmdlets
The promise of PowerShell is to provide a more straightforward, human-readable shell. It’s good to know, then, that Windows Server 2012–based Server Core Print Servers come with 20 Print Server-related PowerShell cmdlets:
- Add-Printer, Get-Printer, Set-Printer, Rename-Printer, and Remove-Printer
- Add-PrinterDriver, Get-PrinterDriver, and Remove-PrinterDriver
- Add-PrinterPort, Get-PrinterPort, and Remove-PrinterPort
- Get-PrintConfiguration and Set-PrintConfiguration
- Get-PrinterProperty and Set-PrinterProperty
- Get-PrintJob, Restart-PrintJob, Suspend-PrintJob, Resume-PrintJob, and Remove-PrintJob
Again, we start with creating a printer port. Begin by typing PowerShell on the console of your Server Core installation and then type:
Add-PrinterPort -Name "10.2.255.11" -PrinterHostAddress "10.2.255.11"
In contrast to the *.vbs-style Printing Admin scripts, you can add a printer, share it, and publish it in one line of PowerShell code:
Add-Printer -Name PRT-Location1-HRM -DriverName "Xerox Global Print Driver PS" -PortName 10.2.255.11 -Shared -ShareName "PRT-Location1-HRM" –Published
Install Printer with PowerShell
Using the GUI
If you feel less adventurous, or if you need to create only one printer, you can use the GUI to create printers. The following command unlocks the Add Printer Wizard:
Another way to add printers with a GUI is to use the Print Management MMC Snap-in from the Remote Server Administration Tools (RSAT).
Managing printers and print jobs ^
With several printers installed on your Server Core Print Server, you might occasionally want to perform management tasks on the print jobs submitted by your co-workers.
Again, you can use the Print Management MMC Snap-in from the Remote Server Administration Tools (RSAT). This tool is automatically installed when you install the RSAT. For more information, read Part 1 of the Server Core Remote Management series.
In the left node, right-click the Print Management node and select Add/Remove Servers… from the context menu. Then, type the name of your Print Server (or Browse… to it) and click Add to list. Click OK when done. Your Server Core Print Server, its printers, and its print jobs can now be managed remotely.
On the console of the server, you can use Get-PrintJob, Restart-PrintJob, Suspend-PrintJob,Resume-PrintJob, and Remove-PrintJob to manage print jobs.
Another neat trick you might have to pull often when dealing with Print Servers is to reset the print spooler. On both Server with a GUI and Server Core Print Servers, this is done with:
net stop spooler && net start spooler
The Print Server Server Role in Server Core installations of Windows Server 2012 is a powerful Server Role, featuring most of the command-line tools available since Windows 2000 Server as well as 20 brand new PowerShell cmdlets. From a remote management perspective, Server Core Print Servers are no different than Server with a GUI Print Servers.