Retrieve User Session count of Web Application

I was wondering if anyone knew how to or if it is even possible to get a web application user session count?

I can get that session count at the Web Site level by doing

Get-Counter "\\$ServerName\web service($website)\current connections"
Since our web site host an n number of web applications, a user connected to the site but using a specific application, so I would like to know what app they are actually using, is this possible?
January 30th, 2015 11:55pm

Might be worth posting over on the IIS forum:

http://forums.iis.net/1151.aspx/1?PowerShell

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 12:04am

See this for an example of what is needed: http://www.xyzws.com/servletfaq/how-to-count-active-sessions-in-your-web-application/11

January 31st, 2015 12:59am

This might also work. It works on WS2008R2

$ServerName =$env:computername
$SiteName = 'default web site'
get-counter "\\$ServerName\web service($SiteName)\current connections"

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 1:04am

This might also work. It works on WS2008R2

$ServerName =$env:computername
$SiteName = 'default web site'
get-counter "\\$ServerName\web service($SiteName)\current connections

February 3rd, 2015 8:29am

Sessions are at the site level.  An application is a service to a site or web so I don't see howthat canbe done.  THe IIS forum might have a way but the question has been asked with no answer that I can find for years.
Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2015 1:00pm

Yeah I posted over there also, just in case. It doesn't seem like it is a possibility at the application level like you said and from what I have researched, but we will see, well at least using PowerShell.

Only way I can see it done, is through the web application itself, to create a static variable in the Global.ascx file, and increase it during the session_start event or decrease it during the session_end event, but since I don't own these applications, that is not possible :-)

February 3rd, 2015 1:08pm

Did you check to see if perf counters have been added to the app pool.  I don't remmeebr them at IIS7 but haven't look at 2008R2 iIIS 7.5 or later,

Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2015 1:19pm

I have not, but will do some searching
February 3rd, 2015 1:22pm

Start with this:

Get-Counter  -ListSet ASP*|select countersetname

Get-Counter  -ListSet ASP* | select -expand counter|?{$_ -match 'session'}

Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2015 5:24pm

Hi Clayman2,

Im writing to just check in to see if the suggestions were helpful. If you need further help, please feel free to reply this post directly so we will be notified to follow it up.

If you have any feedback on our support, please click here.

Best Regards,

Anna Wang

TechNet Community Support

February 10th, 2015 12:56am

No reply from the IIS forum, and from everything I tried searching with, it doesn't look like this can be done at the level I want it to be.
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2015 12:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics