Question:
I asked a question about knowing the running session count in IIS.
Get running session count from IIS for my hosted Asp.Net web site
and I got the following powershell script
1 2 3 4 5 6 7 8 |
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 this script is giving active session count for all websites hosted in IIS
I just wanted to know how to modify this script so that it should give active session count only for a particular website.
Answer:
1 2 3 4 5 |
$ServerName = 'IIs1' $SiteName = 'default web site' get-counter "\\$ServerName\web service($SiteName)\current connections" |