Book Review: Windows Server Automation with PowerShell Cookbook

I was given the opportunity to get a review copy of Thomas Lee’s new book ‘Windows Server Automation with PowerShell Cookbook 4th edition’. And of course, given my eagerness for learning new PowerShell related subjects, I had to give it a go.

Thomas Lee’s new book is focused on using PowerShell 7 for Windows Server administration. The book focuses on Windows Server 2022 and will provide well-explained recipes for utilizing PowerShell 7 in administrating Windows Server.

The book works extremely well as a reference work for quick lookup, how to perform any common Windows Server Administration task with PowerShell 7. You could definitely use the book for inspiration on how you could use PowerShell 7 in your daily tasks, or to learn new and better ways to use PowerShell.

You can find the book on Amazon or following the link Here

About the author

The author Thomas Lee is a 17 time MVP and holds numerous IT certifications. He has experience in IT since the 1960s. Thomas Lee is a well-established author and trainer, teaching PowerShell training and courses around the world. He has authored 8 PowerShell courses on Pluralsight. He has also released multiple books and authored titles such as:

  • ‘Windows Server 2016 Automation with PowerShell Cookbook: Powerful ways to automate and manage Windows administrative tasks, 2nd Edition’
  • ‘Windows Server 2019 Automation with PowerShell Cookbook: Powerful ways to automate and manage Windows administrative tasks, 3rd Edition’

Given the foreword of the book was written by Jeffrey Snover, it only shows the quality with which this book has been written with

Who is the book for?

I definitely see the use cases for people working as sysadmins or with Windows Server in general. I have been using it myself, the last week as a reference work when writing scripts for Windows Server administration. The book also provides good inspiration when refactoring your old scripts.

I see some value in reading the book for learning to write better code, learning new ways to use PowerShell, or if you just need some inspiration for how to use PowerShell 7 with Windows Server

If you are looking for a beginner’s guide to PowerShell or PowerShell 7, then this book might not be for you. It requires that you at least have some knowledge in PowerShell.

PowerShell Subjects

The book provides PowerShell recipes in-depth explanation on the following subjects:

  • Installing and configuring PowerShell 7
  • Introduction to PowerShell 7 and exploring the compatibility with Windows PowerShell
  • Using PowerShell 7 in the enterprise: working with RSAT, PowerShell repositories, script signing, and package management.
  • Exploring .NET
  • Managing Active Directory
  • Networking: Ip addressing, DHCP, DNS, and troubleshooting connectivity
  • Implementing Enterprise security
  • Managing storage
  • Managing shared data: NTFS files and folder permissions, smb shares, iSCSI and FSRM
  • Managing Printing
  • Managing Hyper-V
  • Managing Azure
  • Troubleshooting with PowerShell 7
  • Managing with WMI.

In my opinion, all the important subjects of Windows Server administration are covered. The only thing I think could have been nice to see is a chapter on containers given its focus on Windows Server 2022, but that might be a subject for a book on itself.

The layout

In any technical and especially “code” focused book I find the layout extremely important. Because of the limited page width in a book, it can become extremely hard to display the code in a way that makes it readable for the reader.

In this book, this task has been accomplished very well. The author/editor has heavily used splatting for displaying the code in a readable manner. Splatting gives the option to define an object with the parameters for a function which can then be passed to the function when called. This gives the reader an easy way to read all the parameters for a function.

Example 1, with splitting:

$Args = @{
    Path = "\test\"
    Destination = ".\test-destination-folder\folder1\"
	Recurse = $true
    WhatIf = $true
}
Copy-Item @Args

Example 2, without splitting:

Copy-Item -Path "\test\" -Destination ".\test-destination-folder\folder1\" -Recurse -WhatIf

The author has also accomplished creating a layout of the recipes which manages to showcase the code to the user, with just a highlight of what the code does, then following up afterward on every single line of code, explaining the syntax and functionality of the code. All the recipes are split into four sections:

  • Getting Ready: Here the author explains exactly which server the code should be run on. He also explains what environment you should run it on, either PowerShell 7, VSCode.
  • How to do it: Here the author will walk you through step by step, what code to run. This is a great way of following along and get a short description of what the code does.
  • How it works: Once all the code examples have been displayed step by step, the author will explain each step in-depth, with pictures of code examples. This way of first showing the code, and then explaining it in-depth works great for learning.
  • There’s more: Here the author gives some extra tips on how to improve the code even further. this might consist of some syntax things to be aware of, making the code more efficient, or just some tips and in-depth knowledge on the code examples.

Conclusion

I found the book very well written and pumped full of PowerShell goodness. In contrast to many Cookbooks, Thomas Lee manages to provide the PowerShell code in examples with explanations, in a way that makes the book easy to follow along.

The fact that he has a Github repository containing scripts for creating a virtual machine environment to follow along with is awesome. And even if you don’t want to use his scripts for the environment, you can easily set up your own, to follow along with.

One important thing to be aware of is that you need to have some level of understanding of PowerShell and Windows Server. This is not a book for beginners. Most of the syntax explained in the book requires some knowledge of the PowerShell syntax

The recipes in the book cover a lot of Windows Server and sysadmin tasks, so I definitely see a lot of value for a systems administrator to read the book and learn new ways in performing their daily tasks using PowerShell 7. The recipes in the book cover everything from installing PowerShell 7, managing Active Directory, Implementing Enterprise Security, to managing Azure with PowerShell 7.

In my opinion, this book is definitely worth a read if you are working in a Windows Server environment, using PowerShell in daily your job. I also see the value in reading the book if you are learning PowerShell 7 or just want to get inspired to use PowerShell or start using PowerShell 7.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies. By continuing to use this site, you accept our use of cookies.