Powershell – Check IIS Current Connections using Get-Counter

ever wonder how many people connected to your website?

with a usefull cmdlet named : Get-Counter we can query the IIS for getting the total amount of connections ,and we can query it from each website.

get-counter is basically a cmdlet which letting us use all of the Performance  Counters installed on our system from the PS Console.

PerfCounter_WebService

we can run the cmdlet Get-Counter and getting results of counter samples like –

 -network interface

-processor

-memory

-disk

we can always make use of it for what we really need ,i would like to know how many connections open to my websites ,so i’m gonna use the counter name “web service(SiteName)\Current Connections”

to make it more usefull we’ll make a script which will get all our running websites on the IIS and query each one of them with its current connections

Important, with this script we’ll use the module of webadministration

Get Current Connections from IIS websites –

 

tip: while using get-counter command you can add more servers –

Getting Total Connection from all the IIS using the “_total” keyword –

 

(Visited 4,617 times, 1 visits today)

One thought on “Powershell – Check IIS Current Connections using Get-Counter

Leave a Reply