𝔖 Scriptorium
✦   LIBER   ✦

📁

Windows Server Automation with PowerShell Cookbook: Powerful ways to automate, manage and administrate Windows Server 2022 using PowerShell 7.2, 5th Edition

✍ Scribed by Thomas Lee


Publisher
Packt Publishing
Year
2023
Tongue
English
Leaves
715
Edition
5
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Use over 100 PowerShell 7.2 recipes to deepen your understanding of Windows Server 2022 and see how to automate common administrative tasks with ease

Purchase of the print or Kindle book includes a free eBook in PDF format

Key Features

  • New edition updated to the latest version of PowerShell 7.2 and Windows Server 2022
  • Discover new ways to optimize your PowerShell code by working through easy-to-follow recipes
  • Learn PowerShell best practices to automate common tasks and manage DHCP in Microsoft Windows Server, objects in Active Directory, Hyper-V, and Azure

Book Description

The Windows Server Automation with PowerShell Cookbook is back with a new edition, featuring over 100 PowerShell recipes that will make your day-to-day work easier. This book is designed to help you learn how to install, configure and use PowerShell 7.2 effectively.

To start with, we'll look at how to install and configure PowerShell 7.2, along with useful new features and optimizations, and show you how the PowerShell compatibility solution bridges the gap to older versions of PowerShell. We'll also be covering a wide range of fundamental and more advanced use cases, including how to create a VM and set up an Azure VPN, as well as looking at how to back up to Azure. As you progress, you'll explore topics such as using PowerShell to manage networking and DHCP in Windows Server, objects in Active Directory, Hyper-V, and Azure. We'll also take a closer look at WSUS, containers and see how to handle modules that are not directly compatible with PowerShell 7. Finally, you'll also learn how to use some powerful tools to diagnose and resolve issues with Windows Server.

By the end of this PowerShell book, you'll know how to use PowerShell 7.2 to automate tasks on Windows Server 2022 with ease, helping your Windows environment to run faster and smoother.

What you will learn

  • Perform key admin tasks on Windows Server
  • Keep your organization secure with JEA, group policies, logs, and Windows Defender
  • Use .NET Framework for administrative scripting
  • Manage data and storage on Windows, including disks, volumes, and filesystems
  • Report system performance using built-in cmdlets and WMI to obtain single measurements
  • Apply the right tools and modules to troubleshoot and debug Windows Server
  • Create, manage, and back up a second VM using the subnetwork in Azure
  • Learn how to set up a VPN in Azure with PowerShell

Who this book is for

This book is for systems administrators, software architects, developers, consultants, and engineers working with Windows Server 2022 who want to automate tasks more effectively with PowerShell 7.2. You'll need to have conquered the basics of PowerShell and have a rudimentary understanding of PowerShell scripting before you can get started with this book.

Table of Contents

  1. Installing and Configuring PowerShell 7
  2. Managing PowerShell 7 in the Enterprise
  3. Exploring .NET
  4. Managing Active Directory
  5. Managing Networking
  6. Implementing Enterprise Security
  7. Managing Storage
  8. Managing Shared Data
  9. Managing Printing
  10. Exploring Windows Containers
  11. Managing Hyper-V
  12. Debugging and Troubleshooting Windows Server
  13. Managing Window Server with Window Management Instrumentation (WMI)
  14. Managing Windows Update Services

✦ Table of Contents


Cover
Copyright Page
Table of Contents
Preface
Chapter 1: Installing and Configuring PowerShell 7
Introduction
Systems used in the chapter
Installing PowerShell 7
Getting ready
How to do it...
How it works...
There’s more...
Installing PowerShell 7 Using Chocolatey
Getting ready
How to do it...
How it works...
There’s more...
Using the PowerShell 7 Console
Getting ready
How to do it...
How it works...
There’s more...
Building PowerShell 7 Profile Files
Getting ready
How to do it...
How it works...
There’s more...
Exploring Installation Artifacts
Getting ready
How to do it...
How it works...
There’s more...
Installing VS Code
Getting ready
How to do it...
How it works...
There’s more...
Installing the Cascadia Code Font
How to do it...
How it works...
There’s more...
Exploring PSReadLine
How to do it...
How it works...
There’s more...
Chapter 2: Managing PowerShell 7 in the Enterprise
Introduction
The system used in the chapter
Utilizing Windows PowerShell Compatibility
Getting ready
How to do it...
How it works...
There’s more...
Installing RSAT
Getting ready
How to do it...
How it works...
There’s more...
Exploring Package Management
Getting ready
How to do it...
How it works...
There’s more...
Exploring PowerShellGet and the PS Gallery
Getting ready
How to do it...
How it works...
There’s more...
Creating and Using a Local Package Repository
Getting ready
How to do it...
How it works...
There’s more...
Establishing a Script Signing Environment
Getting ready
How to do it...
How it works...
There’s more...
Working With Shortcuts and the PSShortCut Module
Getting ready
How to do it...
How it works...
There’s more...
Working With Archive Files
Getting ready
How to do it...
How it works...
There’s more...
Searching for Files Using the Everything Search Tool
Getting ready
How to do it...
How it works...
There’s more...
Chapter 3: Exploring .NET
Introduction
The system used in the chapter
Exploring .NET Assemblies
Getting ready
How to do it...
How it works…
There’s more...
Exploring .NET Classes
Getting ready
How to do it...
How it works...
There’s more...
Exploring .NET Methods
Getting ready
How to do it...
How it works...
There’s more...
Creating a C# Extension
Getting ready
How to do it...
How it works...
There’s more...
Creating a cmdlet
Getting ready
How to do it...
How it works...
There’s more...
Chapter 4: Managing Active Directory
Introduction
The systems used in the chapter
Installing a Forest Root Domain
Getting ready
How to do it...
How it works...
There’s more...
Testing an AD installation
Getting ready
How to do it...
How it works...
There’s more...
Installing a Replica Domain Controller
Getting ready
How to do it...
How it works...
There’s more...
Installing a Child Domain
Getting ready
How to do it...
How it works...
There’s more...
Creating and Managing AD Users and Groups
Getting ready
How to do it...
How it works...
There’s more...
Managing AD Computers
Getting ready
How to do it...
How it works...
There’s more...
Adding/Removing Users Using a CSV Files
Getting ready
How to do it...
How it works...
There’s more...
Creating Group Policy Objects
Getting ready
How to do it...
How it works...
There’s more...
Reporting on AD Users
Getting ready
How to do it...
How it works...
There’s more...
Reporting on AD Computers
Getting ready
How to do it...
How it works...
There’s more...
Managing AD Replication
Getting ready
How to do it…
How it works…
There’s more…
Chapter 5: Managing Networking
Introduction
The systems used in the chapter
Configuring IP Addressing
Getting ready
How to do it...
How it works...
There’s more...
Testing Network Connectivity
Getting ready
How to do it...
How it works...
There’s more...
Installing DHCP
Getting ready
How to do it...
How it works...
There’s more...
Configuring DHCP Scopes and Options
Getting ready
How to do it...
How it works...
There’s more...
Using DHCP
Getting ready
How to do it...
How it works...
There’s more...
Configuring a DHCP Reservation
Getting ready
How to do it...
How it works...
There’s more...
Implementing DHCP Fail Over/Load Balancing
Getting ready
How to do it...
How it works...
There’s more...
Implementing DNS in the Enterprise
Getting ready
How to do it...
How it works...
There’s more...
Managing DNS Zones and Resource Records
Getting ready
How to do it...
How it works...
There’s more...
Configuring DNS Forwarding
Getting ready
How to do it...
How it works...
There’s more...
Chapter 6: Implementing Enterprise Security
Introduction
The systems used in the chapter
Implementing Just Enough Administration (JEA)
Getting ready
How to do it...
How it works...
There’s more...
Examining Applications and Services Logs
Getting ready
How to do it...
How it works...
There’s more...
Discovering Logon Events in the Event Log
Getting ready
How to do it...
How it works...
There’s more...
Deploying PowerShell Group Policies
Getting ready
How to do it...
How it works...
There’s more...
Using PowerShell Script Block Logging
Getting ready
How to do it...
How it works...
There’s more...
Configuring AD Password Policies
Getting ready
How to do it...
How it works...
There’s more...
Managing Windows Defender Antivirus
Getting ready
How to do it...
How it works...
There’s more...
Chapter 7: Managing Storage
Introduction
The systems used in the chapter
Managing Disks
Getting ready
How to do it...
How it works...
There’s more...
Managing File Systems
Getting ready
How to do it...
How it works...
There’s more...
Exploring PowerShell Providers and the FileSystem Provider
Getting ready
How to do it...
How it works...
There’s more...
Managing Storage Replica
Getting ready
How to do it...
How it works...
There’s more...
Deploying Storage Spaces
Getting ready
How to do it...
How it works...
There’s more...
Chapter 8: Managing Shared Data
Introduction
The systems used in the chapter
Managing NTFS File and Folder Permissions
Getting ready
How to do it...
How it works...
There’s more...
Securing Your SMB File Server
Getting ready
How to do it...
How it works...
There’s more...
Creating and Securing SMB Shares
Getting ready
How to do it...
How it works...
There’s more...
Accessing SMB Shares
Getting ready
How to do it...
How it works...
There’s more...
Creating an iSCSI Target
Getting ready
How to do it...
How it works...
There’s more...
Using an iSCSI Target
Getting ready
How to do it...
How it works...
There’s more...
Implementing FSRM Filestore Quotas
Getting ready
How to do it...
How it works...
There’s more...
Implementing FSRM Filestore Reporting
Getting ready
How to do it...
How it works...
There’s more...
Implementing FSRM Filestore Screening
Getting ready
How to do it...
How it works...
There’s more...
Chapter 9: Managing Printing
Introduction
The systems used in the chapter
Installing and Sharing Printers
Getting ready
How to do it...
How it works...
There’s more...
Publishing a Printer to Active Directory
Getting ready
How to do it...
How it works...
There’s more...
Changing the Spooler Directory
Getting ready
How to do it...
How it works...
There’s more...
Changing Printer Drivers
Getting ready
How to do it...
How it works...
Printing a Test Page
Getting ready
How to do it...
How it works...
There’s more...
Managing Printer Security
Getting ready
How to do it...
How it works...
There’s more...
Creating a Printer Pool
Getting ready
How to do it…
How it works...
There’s more...
Chapter 10: Exploring Windows Containers
Introduction
The systems used in the chapter
Configuring a container host
Getting ready
How to do it...
How it works...
There’s more...
Deploying sample containers
Getting ready
How to do it...
How it works...
There’s more...
Deploying IIS in a container
Getting ready
How to do it…
How it works...
There’s more...
Using a Dockerfile to create a custom container
Getting ready
How to do it...
How it works...
There’s more...
Chapter 11: Managing Hyper-V
Introduction
The systems used in the chapter
Installing Hyper-V inside Windows Server
Getting ready
How to do it...
How it works...
There’s more…
See also
Creating a Hyper-V VM
Getting ready
How to do it...
How it works...
There’s more...
Using PowerShell Direct
Getting ready
How to do it...
How it works...
There’s more...
Using Hyper-V VM groups
Getting ready
How to do it...
How it works...
There’s more...
Configuring the VM hardware
Getting ready
How to do it...
How it works...
There’s more...
Configuring VM networking
Getting ready
How to do it...
How it works...
There’s more...
Implementing nested virtualization
Getting ready
How to do it...
How it works...
There’s more...
Managing the VM state
Getting ready
How to do it...
How it works...
There’s more...
Managing a VM and VM storage movement
Getting ready
How to do it...
How it works...
There’s more...
Managing VM replication
Getting ready
How to do it...
How it works...
There’s more...
Managing VM checkpoints
Getting ready
How to do it...
How it works...
There’s more...
Creating a Hyper-V report
Getting ready
How to do it...
How it works...
There’s more...
Chapter 12: Debugging and Troubleshooting Windows Server
Introduction
The systems used in the chapter
Using PSScriptAnalyzer
Getting ready
How to do it...
How it works...
There’s more...
Performing BASIC Network Troubleshooting
Getting ready
How to do it...
How it works...
There’s more...
Using Get-NetView to Diagnose Network Issues
Getting ready
How to do it...
How it works...
There’s more...
Using Best Practices Analyzer
Getting ready
How to do it...
How it works...
There’s more...
Exploring PowerShell Script Debugging
Getting ready
How to do it...
How it works...
There’s more...
Chapter 13: Managing Windows Server with Window Management Instrumentation (WMI)
Introduction
WMI architecture
The systems used in the chapter
Exploring WMI Architecture in Windows
Getting ready
How to do it...
How it works...
There’s more...
Exploring WMI Namespaces
Getting ready
How to do it...
How it works...
There’s more...
Exploring WMI Classes
Getting ready
How to do it...
How it works...
There’s more...
Obtaining WMI Class Instances
Getting ready
How to do it...
How it works...
There’s more...
Using WMI Methods
Getting ready
How to do it...
How it works...
There’s more...
Using WMI Events
Getting ready
How to do it...
How it works...
There’s more...
Implementing Permanent WMI Eventing
Getting ready
How to do it...
How it works...
There’s more...
Chapter 14: Managing Windows Update Services
Introduction
The systems used in the chapter
Installing Windows Server Update Services
Getting ready
How to do it...
How it works...
There’s more...
Configuring WSUS Update Synchronization
Getting ready
How to do it...
How it works...
There’s more...
Configuring the Windows Update Client
Getting ready
How to do it...
How it works...
There’s more...
Creating Computer Target Groups
Getting ready
How to do it...
How it works...
There’s more...
Configuring WSUS Automatic Approvals
Getting ready
How to do it...
How it works...
There’s more...
Managing WSUS Updates
Getting ready
How to do it...
How it works...
There’s more...
Other Books You May Enjoy
Packt page
Index


📜 SIMILAR VOLUMES


Windows Server Automation with PowerShel
✍ Thomas Lee 📂 Library 🏛 Packt Publishing 🌐 English

<p><span>Use over 100 PowerShell 7.2 recipes to deepen your understanding of Windows Server 2022 and see how to automate common administrative tasks with ease</span></p><p><span>Purchase of the print or Kindle book includes a free eBook in PDF format</span></p><h4><span>Key Features</span></h4><ul><

Windows Server Automation with PowerShel
✍ Thomas Lee 📂 Library 📅 2021 🏛 Packt Publishing 🌐 English

<p><b>Over 100 PowerShell recipes for working more effectively with Windows Server 2022/2019</b></p><h4>Key Features</h4><ul><li>Develop a holistic understanding of Windows Server 2022/2019 with PowerShell 7.1</li><li>Learn best practices for PowerShell scripting to automate common tasks and manage

Windows Server 2012 Automation with Powe
✍ Ed Goad 📂 Library 📅 2013 🏛 Packt Publishing 🌐 English

Automating server tasks allows administrators to repeatedly perform the same, or similar, tasks over and over again. With PowerShell scripts, you can automate server tasks and reduce manual input, allowing you to focus on more important tasks. Windows Server 2012 Automation with PowerShell Cookbook

Windows Server 2012 Automation with Powe
✍ Ed Goad 📂 Library 📅 2013 🏛 Packt Publishing 🌐 English

Over 110 recipes to automate Windows Server administrative tasks by using PowerShell Overview Extend the capabilities of your Windows environment. Improve the process reliability by using well defined PowerShell scripts. Full of examples, scripts, and real-world best practices. In Detail Automat