New-Website

Creates a new IIS Web site.

Syntax

New-Website
   [-Name] <String>
   [-Id <UInt32>]
   [-Port <UInt32>]
   [-IPAddress <String>]
   [-SslFlags <Int32>]
   [-HostHeader <String>]
   [-PhysicalPath <String>]
   [-ApplicationPool <String>]
   [-Ssl]
   [-Force]
   [<CommonParameters>]

Description

Creates a new IIS Web site with the settings specified in parameter values.

Examples

-------------- EXAMPLE 1: Add a New Web Site --------------

IIS:\>New-WebSite -Name TestSite -Port 80 -HostHeader TestSite -PhysicalPath "$env:systemdrive\inetpub\testsite"

Creates a new Web site named TestSite.

Required Parameters

-Name

The name of the new site to create.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ApplicationPool

The application pool in which the new site executes.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Force

Specifies that the user is not prompted for confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HostHeader

The host header to use for the new site.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IPAddress

The IP address of the new site.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Id

The ID to use for the new site.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PhysicalPath

The physical path to use for the new site. The specified folder must already exist.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Port

The port to use for the new site.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Ssl

Including the Ssl parameter enables HTTPS binding on the site.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SslFlags

Indicates what type of certificate and/or certificate storage the new website supports. Only the following values are valid: 0 (Regular certificate in Windows certificate storage), 1 (SNI certificate), 2 (central certificate store), or 3 (SNI certificate in central certificate store).

Type:Int32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False