How to View the Number of Active User Sessions on Your IIS Website

How to View the Number of Active User Sessions on Your IIS Website

The information about the number of active user sessions is vital for determining and expecting the server load. It also helps you to determine the perfect time for maintaining the server. In addition, you can choose the right time for making the website update.

You can see the number of active user sessions on the IIS site by using the Performance Monitor tool for your Windows hosting. You just need to set a number of counters. There is another way of doing it with the PowerShell. You will find all the details in this article.

Seeing the Number of Active User Sessions on IIS Site with the Performance Monitor Tool

  1. Press Windows + R button. Type perfmon and hit the Enter button.
  2. Now, you have to add the relevant counters for seeing the number of active user sessions. To do it, click on the green “+” button on the toolbar.
  3. Find the Web Service group. Expand it. You will see a list of available counters. For this tutorial, we will be utilizing the following ones:
  • Current Anonymous Users
  • Current Non-Anonymous Users
  • Current Connections
  1. Choose your desired counter. Select your IIS website in the field of Instances of selected objects. Click on the Add>> button. The counter will be added instantly.

  1. Do the same thing for all the required counters. Click on the OK button.
  2. Now, you will see a variety of real-time information related to the active user sessions in the Performance Manager console. You will see the counters that you had added in the bottom pane.

The Performance Monitor tool allows you to add your custom counters to the console. You can save them in a different view for later usage.

Seeing the Number of Active User Sessions on IIS Site with PowerShell

  1. Open PowerShell.
  2. Insert the following command:
(Get-Counter -ListSet 'Web Service').counter
  1. To know the number of active sessions on your website (Site1), write this line:
Get-Counter "web service(Site1)current connections" -ComputerName web-srv01
  1. If you want to check the number of connections on your website locally, use this command:
Get-Counter "web service(Site1)current connections" -ComputerName $env:COMPUTERNAME

Here, you are using the environment variable COMPUTERNAME, as specifying the localhost is not allowed.

  1. If you want to know the current connections on the entire IIS server, type this line:
((Get-Counter -Counter 'web service(_total)current connections' -computer $env:COMPUTERNAME) | Select-Object -Expand countersamples).Cookedvalue

Conclusion

In this article, you have learnt to see the number of active user sessions on your IIS site using the Performance Monitor tool and PowerShell. Now, you can easily analyze the data and take important decisions about maintaining the website at the right time.

Check out these top 3 Windows hosting services:

Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3

How to Configure, Install and Deploy ASP.NET Core to IIS

This article will discuss the way of configuring, installing and deploying ASP.N
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Set Up IIS Application Pool (Windows) in Plesk

IIS Application Pool contains all web applications installed on your sites. You
2 min read
Elizabeth Njoroge
Elizabeth Njoroge
Author

How To Create A Site Navigation Hierarchy With ASP.NET

As your site grows, and as you move pages around in the site, it can become diff
3 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How to Install PostgreSQL on an Ubuntu VPS Running Nginx

Brief description Having a remote database system with a client library, one ma
2 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top