Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By : Thomas Lee, Ed Goad
Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By: Thomas Lee, Ed Goad

Overview of this book

This 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.
Table of Contents (21 chapters)
Title Page
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Configuring IP addressing


Most IT pros are very familiar with setting and using the Windows Control Panel, and more lately the Windows Settings to configure a system's IP configuration (IP address, subnet mask, default gateway and DNS server) and to change a statically configured system to one that gets its configuration from DHCP. Savvy admins also were able to use the network shell, Netsh.exe to set the IP configuration details. In this recipe, we show how you do it with PowerShell and native cmdlets.

Getting ready

You run this recipe on server DC2. Server DC2 is a newly installed VM (or physical machine) whose NICs are default to DHCP. When DC2 boots up, it attempts to contact the DHCP server for IP address configuration. If there is no DHCP server on your subnet, running Get-NetIPConfiguration reveals that the server has an Automatically Provided IP Address (APIPA) in the 169.254/16 range. You use this recipe to provide a static IP configuration to this server.

How to do it...

  1. Get the existing...