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

Modifying printer security


As you saw in the previous recipe, Reporting on printer security, the DACL for a printer defines what access Windows allows to the printer. To change the set of permissions, you need to change the DACL. You could, for example, update the DACL on the Sales Group printer to just allow members of the Sales Group to print on the printer. This recipe updates the DACL to enable the AD Sales Group to print to the Sales Group printer.

Getting ready

Before you can run this recipe, you need to create a group in the AD. In this recipe, you use a group, Sales Group, contained in the Sales OU. To create the OU, the domain local group, do the following:

# Creating the OU and Group$SB = { New-ADOrganizationalUnit -Name 'Sales'                                 -Path 'DC=Reskit,DC=Org'        New-ADGroup -Name 'Sales Group'                    -Path 'OU=Sales,DC=Reskit,DC=Org'                    -GroupScope DomainLocal}Invoke-Command -ComputerName DC1 -ScriptBlock $SB

How to do it.....