Installing and configuring IIS

Websites are useful for multiple every day needs, from hosting static content, such as pictures, to dynamic content, such as calendars, and even web services. IIS in Windows Server 8 is extended greatly with additional PowerShell commands and functions.

This recipe will cover how to set up a basic IIS website and configure binding information.

Getting ready

For installing IIS, we will be using a basic Windows Server without any features installed.

How to do it...

Carry out the following steps to install and configure IIS:

  1. Open a PowerShell console and install IIS:
    Get-WindowsFeature | Where-Object Name –likeweb*
    Install-WindowsFeature Web-WebServer –IncludeManagementTools
  2. Use Import-Module to load the WebAdministration

Get Windows Server 2012 Automation with PowerShell Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.