New-WebSitesHostName

Adds a host name to a website.

Syntax

New-WebSitesHostName [-SiteName] <String> [-Name] <String> [-Confirm] [-ConnectionString <String>] [-WhatIf]
 [<CommonParameters>]

Description

The New-WebSitesHostName cmdlet adds a host name to website.

Examples

Example 1: Add a host name to a site

PS C:\> New-WebSitesHostName -SiteName "Site01" -Name "support.contoso.com"
This command adds the host name support.contoso.com to the site Site01.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

-ConnectionString

Specifies a connection string for a hosting database.
Connection strings contain information about a data source and how to connect to it; this information includes such things as the server and database name, and the name and password of the user account making the connection.
For example:

-ConnectionString "Server=tcp:contosodb.database.windows.net;Database=Personel;User ID=admin@contoso.com;Password=p@ssw0rd;Trusted_Connection=False;Encrypt=True;"

If you do not specify this parameter New-WebSitesHostName uses the default instance of the hosting database.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the host name being added to the website.
For example:

-Name "www.contoso.com"

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

-SiteName

Specifies the name of the website that the host associated with.
For example:

-SiteName "ContosoInternal"

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

-WhatIf

Shows what would happen if the cmdlet runs.
The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False