title: How to know the active session counts for a particular website hosted in IIS using PowerShell
body: <p>I asked a question about knowing the running session count in IIS.</p>
  
  <p><a href="https://stackoverflow.com/questions/9734561/get-running-session-count-from-iis-for-my-hosted-asp-net-web-site">Get running session count from IIS for my hosted Asp.Net web site</a></p>
  
  <p>and I got the following powershell script </p>
  
  <pre><code>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
  </code></pre>
  
  <p>Rightnow this script is giving active session count for all websites hosted in IIS</p>
  
  <p>I just wanted to know how to modify this script so that it should give active session count only for a particular website.</p>