Book Image

Windows Server 2012 R2 Administrator Cookbook

By : Jordan Krause
Book Image

Windows Server 2012 R2 Administrator Cookbook

By: Jordan Krause

Overview of this book

Table of Contents (17 chapters)
Windows Server 2012 R2 Administrator Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Installing the Web Server (IIS) role with PowerShell


If you haven't started using PowerShell to accomplish some of your regular Windows Server tasks, do it now! PowerShell can be used in Windows Server 2012 R2 to accomplish any task or configuration inside the operating system. I am a huge fan of using the keyboard instead of the mouse in any situation, and saving scripts that can be used over and over to save time in the future.

In this recipe, we are going to explore the Install-WindowsFeature cmdlet that can be used to add a role or roles to your Server 2012 R2. Since we are discussing IIS in this chapter, let's take our newly created web server and use PowerShell to place the Web Server (IIS) role onto it.

Getting ready

There is a new Windows Server 2012 R2 web server in our environment called WEB-02. Let's use PowerShell on this machine in order to install the IIS role.

How to do it...

To add the Web Server (IIS) role to WEB-02 via PowerShell:

  1. Log in to WEB-02 and open a PowerShell prompt...