ebook img

Windows Server 2019 automation with PowerShell cookbook : powerful ways to automate manage Windows administrative tasks PDF

543 Pages·2019·22.023 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Windows Server 2019 automation with PowerShell cookbook : powerful ways to automate manage Windows administrative tasks

1 Windows Server 2019 Automation with PowerShell Cookbook Third Edition Powerful ways to automate and manage Windows administrative tasks Thomas Lee BIRMINGHAM - MUMBAI Windows Server 2019 Automation with PowerShell Cookbook Third Edition Copyright © 2019 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Commissioning Editor: Vijin Boricha Acquisition Editor: Meeta Rajani Content Development Editors: Abhishek Jadhav Technical Editor: Mohd Riyan Khan Copy Editor: Safis Editing Project Coordinator: Jagdish Prabhu Proofreader: Safis Editing Indexers: Pratik Shirodkar Graphics: Tom Scaria Production Coordinator: Arvindkumar Gupta First published: March 2013 Second edition: September 2017 Third edition: February 2019 Production reference: 1280219 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78980-853-7 www.packtpub.com mapt.io Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website. Why subscribe? f Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals f Learn better with Skill Plans built especially for you f Get a free eBook or video every month f Mapt is fully searchable f Copy and paste, print, and bookmark content Packt.com Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. Foreword "Take my money!" "I'll buy it now!" I was confused. I was in front of a couple of hundred people presenting Monad (what later became PowerShell) and some guy in the back of the room shouting, "Take my money!". That is how I met Thomas Lee. After the talk, Thomas comes up to me and gave me a $20 bill with his name on it and said that Monad was exactly what Windows administrators needed and it was going to revolutionize the world and that he wanted to be the first person in line to buy it. When I explained that it was going to be included as a free feature of Windows, Thomas said that he didn't care, he wanted to be the first to buy it anyway. I just double checked and I still have that $20 bill in my wallet. I've kept it with me for the last 17 years to remind myself what Thomas saw so clearly that day – PowerShell is a critically important tool for every professional Windows administrator. I use the adjective "professional" because there really are two different types of Windows administrators: professional and non-professional. One of the reasons why Windows is so wildly successful is because non- professional administrators could successfully set up and run it to for simple scenarios. If you can click the Next button, then chances are that you can set up Windows successfully. What Thomas correctly saw was that the world of "click-next" administration was limited and that there was an increasing need for professional administrators that could understand the specific needs of their scenario and could craft Windows to meet those needs. That task needed a new tool. That task needed PowerShell. If you are a professional administrator (or just a passionate power user), then you need to be skilled in PowerShell and you need to know how the specific version of the operating system you are working with is managed by PowerShell. Every version of Windows has added new capabilities that can be managed by PowerShell. In this book, Thomas shows you how to get the most of out your investment in Windows Server 2019 by explaining how to manage and automate it using PowerShell. Automation means that you can figure out how to manage one server and then use that script to manage 10s, 100s, 100,000s of other servers. It means consistency, repeatability, and productivity. It is all about professional administration. Over the years, I have had so many administrators thank me for PowerShell and tell me their success stories. They were able to do things that saved the day, that their companies only dreamed was possible and that their click-next co-workers could not. They were rewarded with bonuses, raises, promotions, new jobs. I've had quite a few people tell me that they have tripled their salaries because of learning PowerShell. PowerShell makes YOU powerful. Thomas was the first one to understand this with absolute clarity and has been with the team from the beginning actively providing us feedback on what professional administrators needed from PowerShell. Thomas's views of administration are very much reflected in PowerShell you see today so I can think of few people better equipped to help you understand how to use this wonderful tool to manage Windows Server 2019 so that you can deliver great value to your company and get rewarded because of it. Jeffrey Snover Microsoft Technical Fellow Contributors About the author Thomas Lee is a consultant/trainer/writer from England and has been in the IT business since the late 1960's. After graduating from Carnegie Mellon University, Thomas joined ComShare where he was a systems programmer building the Commander II time-sharing operating system, a forerunner of today's Cloud computing paradigm. In the mid 1970's he moved to ICL to work on the VME/K operating system. After a sabbatical in 1980/81, he joined what is today known as Accenture, leaving in 1988 to run his own consulting and training business, which is still active today. Thomas holds numerous Microsoft certifications, including MCSE (one of the first in the world) and later versions, MCT (25 years), and was awarded Microsoft's MVP award 17 times. He lives today in a cottage in the English countryside with his family, a nice wine cellar, and a huge collection of live recordings by The Grateful Dead and The Jerry Garcia band. I'd first like to thank Jeffrey Snover of Microsoft for the invention of PowerShell. I was lucky enough to be in the room the very first time he presented what was then called Monad. His enthusiasm was infectious, and over 15 years later I am still excited. A huge thank you has to go to the Packt team: Meeta Rajani, Abhishek Jadhav, Mohd Riyan Khan, and Danish Shaikh. You guys did a great job getting this book out of the door and dealing with the issues that arose during the writing. And thanks too to our most excellent tech reviewer Alexander Wittig. Your reviews were always commendable. As each recipe evolved, I would sometimes hit problems. I got a lot of help from the Spiceworks community. Their PowerShell forum is a great source of information and encouragement. If you have problems with PowerShell, this is a great place to get a solution. And finally, I have to thank my wonderful wife, Susan. She has been patient as things progressed, she put up with my bad moods when progress was not as smooth as desirable, and kept me sane when all around me was craziness. About the reviewer Alex Wittig is a U.S. based Systems Engineer from Germany. He is a Spiceworks Hero Award winner and Moderator at PowerShell. He holds a BSc in IT Security and about half a pound worth of professional IT certifications. Coffee maven, cat stroker, internet fanatic and lifelong learner. He can be found on Twitter @alexvvittig. Packt is Searching for Authors Like You If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea. Table of Contents Preface v Chapter 1: Establishing a PowerShell Administrative Environment 1 Introduction 2 Installing RSAT tools on Window 10 and Windows Server 2019 2 Exploring package management 12 Exploring PowerShellGet and the PSGallery 16 Creating an internal PowerShell repository 25 Establishing a code-signing environment 30 Implementing Just Enough Administration 36 Chapter 2: Managing Windows Networking 45 Introduction 45 New ways to do old things 46 Configuring IP addressing 54 Installing and authorizing a DHCP server 57 Configuring DHCP scopes 59 Configuring IP addresses from static to DHCP 62 Configuring DHCP failover and load balancing 64 Configuring DNS servers, zones, and resource records 67 Chapter 3: Managing Windows Active Directory 75 Introduction 75 Installing Active Directory with DNS 76 Creating and managing AD users, groups, and computers 82 Adding users to AD via a CSV file 89 Creating a group policy object 92 Reporting on AD users 96 Finding expired computers and disabled users in AD 100 i

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.