Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows Server 2019 Automation with PowerShell Cookbook

You're reading from   Windows Server 2019 Automation with PowerShell Cookbook Powerful ways to automate and manage Windows administrative tasks

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789808537
Length 542 pages
Edition 3rd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Thomas Lee Thomas Lee
Author Profile Icon Thomas Lee
Thomas Lee
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Establishing a PowerShell Administrative Environment FREE CHAPTER 2. Managing Windows Networking 3. Managing Windows Active Directory 4. Managing Windows Storage 5. Managing Shared Data 6. Managing Windows Update 7. Managing Printing 8. Introducing Containers 9. Managing Windows Internet Information Server 10. Managing Desired State Configuration 11. Managing Hyper-V 12. Managing Azure 13. Managing Performance and Usage 14. Troubleshooting Windows Server Index

Installing and configuring Hyper-V


With Windows Server 2019, to add Hyper-V to your server, you install the Hyper-V feature. This recipe installs Hyper-V on two servers: HV1 and HV2, which are domain-joined Windows 2019 servers with no added features.

Getting ready

In this recipe, you do the set up remotely from a client machine, CL1, using the Hyper-V cmdlets and PowerShell's remoting capabilities. CL1 is a domain-joined Windows 10 system with the RSAT tools installed. You previously set up the CL1 client in the Installing RSAT tools on Windows 10 and Windows Server 2019 recipe.

How to do it...

  1. From CL1, install the Hyper-V feature on HV1 and HV2:

    $Sb = {
      Install-WindowsFeature -Name Hyper-V -IncludeManagementTools
    }
    Invoke-Command -ComputerName HV1, HV2 -ScriptBlock $Sb
  2. Reboot both servers to complete the installation:

    Restart-Computer -ComputerName HV1, HV2 -Force 
  3. Create a PSSession with both HV servers (after the restart has completed):

    $S = New-PSSession HV1, HV2
  4. Create and set the location...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime