- 660 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Windows Server 2016 Automation with PowerShell Cookbook - Second Edition
About This Book
Over 100 recipes to help you leverage PowerShell to automate Windows Server 2016 manual tasksAbout This Book⢠Automate Windows server tasks with the powerful features of the PowerShell Language⢠Master new features such as DevOps, containers, and Nano servers, and speed up their performance using PowerShell⢠Improve PowerShell's usability, and control and manage Windows-based environments by working through inviting recipesWho This Book Is ForIf you are a systems administrator, engineer, or an architect working with Windows Server 2016 and want to automate tasks with PowerShell, then this book is for you. A basic knowledge of PowerShell is expected.What You Will Learn⢠Streamline routine administration processes⢠Improve the performance and storage of your Windows server with enhanced large-scale PowerShell scripts⢠Use DSC to leverage Windows server features⢠Generate automatic reports that highlight unexpected changes in your environment⢠Monitor performance and report on system utilization using detailed graphs and analysis⢠Create and manage a reliable and redundant Hyper-V environment⢠Manage your enterprise's patch level⢠Utilize multiple tools and protocols to manage your environmentIn DetailThis 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.Style and approachThis is a practical guide packed with attractive recipes to help you effectively use PowerShell to accelerate your daily administrative tasks with Windows server.
Frequently asked questions
Information
Managing Hyper-V
- Installing and configuring Hyper-V feature
- Using Windows PowerShell Direct
- Securing Hyper-V host
- Creating a virtual machine
- Configuring VM hardware
- Configuring Hyper-V networking
- Implementing nested Hyper-V
- Managing VM state
- Configuring VM and storage movement
- Configuring VM replication
- Managing VM checkpoints
- Monitoring Hyper-V utilization and performance
- Creating a Hyper-V health report
Introduction
Installing and configuring Hyper-V feature
Getting ready
# Add windows optional feature for CL1 Enable-WindowsOptionalFeature ` -FeatureName Microsoft-Hyper-V-All ` -Online -NoRestart Restart-Computer -Computername CL1 -Force
How to do it...
- From CL1, install the Hyper-V feature on HV1, HV2:
$Sb = {
Install-WindowsFeature -Name Hyper-V `
-IncludeManagementTools }
Invoke-Command -ComputerName HV1, HV2 `
-ScriptBlock $Sb
- Reboot the servers to complete the installation:
Restart-Computer -ComputerName HV1, HV2 -Force `
-Wait -For -PowerShell
- Create and set the location for VMs and VHDs on HV1 and HV2, then view results:
$Sb = {
New-Item -Path H:\Vm -ItemType Directory -Force |
Out-Null
New-Item -Path H:\Vm\Vhds -ItemType Directory -Force |
Out-Null
New-Item -Path H:\Vm\VMs -ItemType Directory -force |
Out-Null
Get-ChildItem -Path H:\Vm }
Invoke-Command -ComputerName HV1, HV2 -ScriptBlock $Sb
- Set default paths for Hyper-V VM hard disks and VM configuration information:
Set-VMHost -ComputerName HV1,HV2 `
-VirtualHardDiskPath 'H:\Vm\Vhds'
Set-VMHost -ComputerName HV1,HV2 `
-VirtualMachinePath 'H:\Vm\VMs'
- Setup NUMA spanning:
Set-VMHost -ComputerName HV1,HV2 -NumaSpanningEnabled $true
- Set up EnhancedSessionMode:
Set-VMHost -ComputerName HV1,HV2 `
-EnableEnhancedSessionMode $true
- Setup host resource metering on HV1, HV2:
$RMInterval = New-TimeSpan -Hours 0 -Minutes 15
Set-VMHost -CimSession HV1, HV2 -ResourceMeteringSaveInterval
$RMInterval
- Review key VMHost settings:
Get-VMHost -ComputerName HV1, HV2 |
Format-List -Property Name, MemoryCapacity,
Virtu...
Table of contents
- Title Page
- Copyright
- Credits
- About the Author
- Acknowledgment
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Preface
- What's New in PowerShell and Windows Server
- Implementing Nano Server
- Managing Windows Updates
- Managing Printers
- Managing Server Backup
- Managing Performance
- Troubleshooting Windows Server 2016
- Managing Windows Networking Services
- Managing Network Shares
- Managing Internet Information Server
- Managing Hyper-V
- Managing Azure
- Using Desired State Configuration