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

Reporting on printer usage


Printer usage information is useful for capacity planning, and possibly budgeting, for your shared printers. By default, printer usage details are unmonitored, but you can turn logging on (and off!). When you enable printer usage monitoring, the Windows Spooler service writes a record to the event log for each print job containing critical usage information.

This recipe shows you how to turn on printer usage reporting and shows how to create a function to return printer usage information. This recipe creates a function that returns printer usage information as objects. Objects are easier as they enable you to process the output specifically for your environment-for example, counting the total number of pages printed, reporting on who is using the printer, and so on.

Getting ready

Run this recipe on PSRV where you have already set up a printer. This recipe assumes you have set up a printer. You also need to use the printer a bit to generate some event log entries on...