How to find out the number of active sessions for a specific website hosted in IIS using PowerShell
I asked a question about knowing the session counter in IIS.
and I got the following powershell script
Write-host Getting performance counters ... $perfCounterString = "\asp.net applications(__total__)\sessions active" $counter = get-counter -counter $perfCounterString $rawValue = $counter.CounterSamples.CookedValue write-host Session Count is $rawValue
Correct, this script gives an active session count for all websites hosted in IIS
I just wanted to know how to change this script so that it should only give an active session for a specific website.
source to share