Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

There's more...

By creating a function that returns an object for each event log entry, you get significant flexibility in using the output of the function. The Get-PrinterUsage function changes the type name of the returned object. With a custom type name, you could create a customized display XML that creates an output that suits your requirements. You can also use the objects returned and filter out the usage of specific printers by user. You can also use Measure-Object to get the total number of pages printed, the average pages per job, and the maximum print job length.