Get-IISSite

Gets configuration information for an IIS Web site.

Syntax

Get-IISSite
   [[-Name] <String[]>]
   [<CommonParameters>]

Description

The Get-IISSite cmdlet gets information about Internet Information Services (IIS) web sites and their current status and other key information. If you a request a specific site or a comma delimited list of sites, only those whose names are passed as an argument are returned. Otherwise all the websites are returned.

Examples

Example 1: Get information about an IIS website

PS C:\> Get-IISSite "Default Web Site"

This command gets the configuration information for the Default Web Site.

Example 2: Get information about all IIS websites

PS C:\> Get-IISSite
Name             ID   State      Physical Path                  Bindings
----             --   -----      -------------                  --------
Default Web Site 1    Started    %SystemDrive%\inetpub\wwwroot  http *:80: 
PattiFul         2    Stopped    C:\inetpub\PattiFul            http *:8080: 
                                                                http *:8033: 
FTPSite          3               C:\inetpub\ftproot             ftp *:21: 
DavidChe         4    Started    c:\                            http *:8088: 
MyNewSite        6555 Started    C:\inetpub\wwwroot             http *:8099: 
                                                                http *:8022:

This command gets all configuration information about all IIS websites

Example 3: Get an attribute for an IIS website

PS C:\> $Site = Get-IISSite "Default Web Site"
PS C:\> $Site.Attributes["ServerAutoStart"]
IsInheritedFromDefaultValue : True
IsProtected                 : False
Name                        : serverAutoStart
Schema                      : Microsoft.Web.Administration.ConfigurationAttributeSchema
Value                       : True

This command gets the ServerAutoStart attribute for the IIS Default Web Site.

Optional Parameters

-Name

Specifies the name of the IIS website to get configuration information. If this parameter is not used, all sites are returned.

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

Inputs

String, array of string

Outputs

Microsoft.Web.Administration.Site