2012-03-29 10 views
3

IISで実行中のセッション数を知ることについて質問しました。PowerShellを使用してIISでホストされている特定のWebサイトのアクティブセッション数を知る方法

Get running session count from IIS for my hosted Asp.Net web site

と私は

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 

のRightNowこのスクリプトは、私はちょうどこれを修正する方法を知りたいと思った

IISでホストされているすべてのウェブサイトのためのアクティブなセッション数を与えている次のPowerShellスクリプトを得ました特定のウェブサイトに対してのみ有効なセッション数を与えるようにします。

答えて

7
$ServerName = 'IIs1' 
$SiteName = 'default web site' 

get-counter "\\$ServerName\web service($SiteName)\current connections" 
+0

おかげで、テストの後にお知らせします。 –

関連する問題