description | external help file | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|---|
Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. |
Microsoft.IIS.Powershell.Commands.dll-Help.xml |
IISAdministration |
12/20/2016 |
2.0.0 |
Get-IISServerManager |
Gets the IISAdministration view of IIS ServerManager.
Get-IISServerManager [<CommonParameters>]
The Get-IISServerManager cmdlet gets Internet Information Services (IIS) server manager object from Microsoft.Web.Administration.
PS C:\> $SM = Get-IISServerManager
This command gets the active Microsoft.Web.Administration.ServerManager object and stores the result into the variable $SM.
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.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).