我问了一个关于了解 IIS 中正在运行的会话计数的问题。
从 IIS 获取我托管的 Asp.Net 网站的运行会话计数 https://stackoverflow.com/questions/9734561/get-running-session-count-from-iis-for-my-hosted-asp-net-web-site
我得到了以下 powershell 脚本
Write-host Getting performance counters ...
$perfCounterString = "\asp.net applications(__total__)\sessions active"
$counter = get-counter -counter $perfCounterString
$rawValue = $counter.CounterSamples[0].CookedValue
write-host Session Count is $rawValue
现在,此脚本正在为 IIS 中托管的所有网站提供活动会话计数
我只是想知道如何修改此脚本,以便它只提供特定网站的活动会话计数。
$ServerName = 'IIs1'
$SiteName = 'default web site'
get-counter "\\$ServerName\web service($SiteName)\current connections"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)