Table of contents
TLS
TOC
Collapse the table of content
Expand the table of content

Get-IISServerManager

Last Updated: 3/30/2017

SYNOPSIS

Gets the IISAdministration view of IIS ServerManager.

SYNTAX

Get-IISServerManager [<CommonParameters>]

DESCRIPTION

The Get-IISServerManager cmdlet gets Internet Information Services (IIS) server manager object from Microsoft.Web.Administration.

EXAMPLES

Example 1: Get an active Microsoft.Web.Administration.ServerManager object

PS C:\> $SM = Get-IISServerManager

This command gets the active Microsoft.Web.Administration.ServerManager object and stores the result into the variable $SM.

Example 2: Use the ServerManager object to get site objects and list IIS Web sites

PS C:\> $SM = Get-IISServerManager
PS C:\> $Sites = $SM.Sites
PS C:\> $Sites
Name             ID   State      Physical Path                  Bindings
----             --   -----      -------------                  --------
Default Web Site 1    Stopped    %SystemDrive%\inetpub\wwwroot  http *:80: 
Patti            2    Started    C:\inetpub\Patti               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: 
TestSite         5    Stopped    C:\inetpub\testsite            http *:8080:

This command gets site objects and lists all IIS web sites by using the ServerManager object.

Example 3: Use the ServerManager object to get application pool objects and recycle an application pool.

PS C:\> $SM = Get-IISServerManager
PS C:\> $SM.ApplicationPools["PattiFul"].Recycle()

This command uses the ServerManager object to get application pool objects and then recycles an application pool.

PARAMETERS

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

Microsoft.Web.Administration.ServerManager

NOTES

© 2017 Microsoft