加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 如何使用PowerShell了解IIS中托管的特定网站的活动会

发布时间:2020-12-16 06:38:27 所属栏目:asp.Net 来源:网络整理
导读:我问了一个关于知道IIS中运行会话数的问题. Get running session count from IIS for my hosted Asp.Net web site 我得到了以下的powershell脚本 Write-host Getting performance counters ...$perfCounterString = "asp.net applications(__total__)sessi
我问了一个关于知道IIS中运行会话数的问题.

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 "$ServerNameweb service($SiteName)current connections"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读