Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By : Thomas Lee, Ed Goad
Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By: Thomas Lee, Ed Goad

Overview of this book

This book showcases several ways that Windows administrators can use to automate and streamline their job. You'll start with the PowerShell and Windows Server fundamentals, where you'll become well versed with PowerShell and Windows Server features. In the next module, Core Windows Server 2016, you'll implement Nano Server, manage Windows updates, and implement troubleshooting and server inventories. You'll then move on to the Networking module, where you'll manage Windows network services and network shares. The last module covers Azure and DSC, where you will use Azure on PowerShell and DSC to easily maintain Windows servers.
Table of Contents (21 chapters)
Title Page
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Changing the spool directory


By default, Windows uses the folder %SystemRoot%\System32\spool\PRINTERS to store spooled jobs. On our print server, PSRV, this folder is C:\Windows\System32\spool\PRINTERS. In some cases, particularly when your users generate large amounts of printed output, this folder and the volume could become full, which is not a good thing. To help you avoid issues, you can move the default spool directory to a different folder (for example, C:\Spool), or you could move the spool folder to a folder on another volume (for example, E:\Spool).

Getting ready

There are two ways you can change the spool directory. The first way is to use the classes inside the .NET Framework's System.Printing namespace to update the folder name. The second, and probably the simplest, way is to update the registry with the folder to use for spooling. This recipe shows both methods.

How to do it...

First, let's look at how you change the spool folder using the .NET Framework:

  1. Load the System.Printing...