如何使用 PowerShell 获取 IIS 应用程序池回收设置?


若要通过 GUI 获取 IIS 应用程序池回收设置,您需要检查应用程序池高级设置。

要使用 PowerShell 检索上述设置,我们可以将 Get-IISAppPool 命令与特定的应用程序池名称一起使用。我们有应用程序池 DefaultAppPool,我们需要检索其 Recycling 设置。

PS C:\> (Get-IISAppPool -Name DefaultAppPool).Recycling

输出

以下设置将针对定期重启。

PS C:\> (Get-IISAppPool -Name DefaultAppPool).Recycling.PeriodicRestart

输出

Memory          : 0
PrivateMemory   : 102400
Requests        : 0
Schedule        : {add}
Time            : 1.05:00:00
Attributes      : {memory, privateMemory, requests, time}
ChildElements   : {schedule}
ElementTagName  : periodicRestart
IsLocallyStored : True
Methods         :
RawAttributes   : {[memory, 0], [privateMemory, 102400], [requests, 0], [time, 1.05:00:00]}
Schema          : Microsoft.Web.Administration.ConfigurationElementSchema

在进一步展开时,您可以添加 Privatememory、Time 等属性。

更新于: 28-4 月-2021

2K+ 浏览

开启你的事业

通过完成课程获得认证

开始入门
广告
© . All rights reserved.