#PSTip How to get the number of IIS current client connections

Note: This tip requires PowerShell 2.0 or above.

Using the Get-Counter cmdlet and the Web Service Current Connections performance counter, you can get the amount of current connections to an IIS server or to one of its web sites. This counter is extremely useful in load balanced environments where you want to make sure that connections are evenly balanced across a group of IIS servers.

The following command gets the total number of connections for the server:

This example gets the number of connections for a specified website of three front end servers of a SharePoint farm:

Filed in: Columns, Tips and Tricks Tags: , ,

2 Responses to "#PSTip How to get the number of IIS current client connections"

  1. Roger Britten says:

    Hi Shay,

    I know this is fairly old but I was wondering how to see individual connections instead of old. I’m looking for a way to kill an individual connection instead of doing an IISRESTART. I’m still learning PS but getting the hang of it and yes get-help example & full are my bestfriend.

    Any help would be appreciated and thanks in advance.

  2. Shay Levy says:

    Hi Roger

    I’m not aware of a way to remove specific connections. If your application is running under an app pool account then you might want to try and recycle it instead of an IIs reset.

Leave a Reply

Submit Comment

© 9370 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.
%d bloggers like this: