Changing the spool directory
During the printing process, the Windows printer spooler in Windows uses an on-disk folder to hold the temporary files that have been created. If multiple users each print large documents to a single printer, the print queue can get quite large. By default, this folder is C:\Windows\System32\spool\PRINTERS
. For a busy print server with multiple printers, you may wish to change the default spool folder.
Getting ready
This recipe uses the PSRV
printer server that was set up as per the Installing and sharing printers recipe.
How to do it...
Load the
System.Printing
namespace and classes:Add-Type -AssemblyName System.Printing
Define the required permissions—that is, the ability to administrate the server:
$Permissions = [System.Printing.PrintSystemDesiredAccess]:: AdministrateServer
Create a
PrintServer
object (in memory) with the required permissions:$NOHT = @{ TypeName = 'System.Printing.PrintServer' ArgumentList = $Permissions } $PS = New-Object...