Get-WebSitesHostName

Gets host names for a web site.

Syntax

Get-WebSitesHostName [[-SiteName] <String>] [-ConnectionString <String>] [-OwnerName <String>]
 [-WorkerName <String>] [<CommonParameters>]

Description

The Get-WebSitesHostName cmdlet gets host names for a website.
Host names are the names that users type into their web browsers in order to access a site; for example, "www.contoso.com" or "support.contoso.net".
A single site can be assigned more than one host name.

Used without any parameters, Get-WebSitesHostName returns information about all your website host names.
However, you can also choose to return a subset of host names; for example, you can return all the host names for a specific site or all the host names associated with a specific owner.

Examples

Example 1: Get a host name for a site

PS C:\> Get-WebSitesHostName -SiteName "Site01"
This command gets the host names for the website named Site01.

Parameters

-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 Get-WebSitesHostName automatically connects to the default instance of the hosting database.

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

-OwnerName

Specifies the name of a website owner.
For example:

-OwnerName "PattiF"

When this parameter is used Get-WebSitesHostName returns host names for the websites owned by the specified user.

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

-SiteName

Specifies the name of the site from which the host names are retrieved.
For example:

-Site "ContosoInternal"

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

-WorkerName

Specifies the name of a website worker (workers perform background processing for websites).
For example:

-WorkerName "ContosoWorker1"

When this parameter is used Get-WebSitesHostName returns all the host names associated with the specified worker.

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