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

Publishing a printer


Once you create and share a printer, as shown in the previous recipe, you can additionally publish it to the Active Directory. When you publish a printer, you can also specify a location for the printer that enables your users to search for published printers based on location and capabilities. End users can search AD to find printers and to find the printers near to them. In this recipe, you publish the printer you created in the previous recipe and examine the results.

Getting ready

In this recipe, you publish the printer that you created in the preceding recipe, Installing and sharing printers.

How to do it...

  1. Get the printer to publish and store the returned object in $Printer:
$Printer = Get-Printer -Name SGCP1
  1. Observe the publication status:
$Printer | Format-Table -Property Name, Published
  1. Publish the printer to AD:
$Printer | Set-Printer -Published $true `                         -Location '10th floor 10E4'
  1. View the updated publication status:
Get-Printer -Name SGCP1 |...