TechBuzzPro

How to Monitor Active Sessions on IIS: Step-by-Step

· 5 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To monitor active sessions on IIS, the quickest reliable method is to use the IIS Manager's Worker Processes feature, which shows current requests and sessions per application pool. For ongoing or historical monitoring, enable Failed Request Tracing or use Performance Monitor counters. You can also query the IIS logs for session activity, though logs are retrospective. This guide walks through each method with exact steps, plus what to check when things don't behave as expected. No special tools are required beyond the built-in IIS management console and administrative access to the server.

What You'll Need

  • Administrative access to the IIS server (local or via Remote Desktop).
  • IIS Manager installed (part of the Web Server role; if missing, add it via Server Manager > Add Roles and Features > Web Server (IIS) > Management Tools > IIS Management Console).
  • For Performance Monitor: access to the server's Performance Monitor tool (built into Windows).
  • For Failed Request Tracing: the Tracing feature installed (add via Server Manager > Web Server > Health and Diagnostics > Tracing).
  • Optional: a text editor for reviewing log files.

Note: Menu labels in IIS Manager can differ slightly between Windows Server versions and IIS versions. The steps below reflect common layouts; if a label is not exactly as shown, look for the closest match.

Step-by-Step

  1. Open IIS Manager. Press Win+R, type inetmgr, and press Enter. Alternatively, open Server Manager > Tools > Internet Information Services (IIS) Manager.
  2. Select the server node. In the left Connections pane, click the server name (not a site) to view server-level features.
  3. Open Worker Processes. In the center Features View, double-click Worker Processes. This lists each application pool's worker process (w3wp.exe) with columns for Process ID, CPU, and memory. This is the starting point for active session visibility.
  4. View current requests. With Worker Processes open, select a worker process and click View Current Requests in the Actions pane. A list of active requests appears, showing the requested URL, the client IP, and the time elapsed. This is the closest built-in view to "active sessions" at the request level.
  5. Check session state (if used). If your application uses ASP.NET Session State, active sessions are not directly listed in IIS Manager. Instead, use Performance Monitor: open Performance Monitor (press Win+R, type perfmon), add the counter ASP.NET Applications > Sessions Active for the relevant application instance. This shows the number of active sessions over time.
  6. Enable and use Failed Request Tracing for detailed request tracking. In IIS Manager, select the site, then double-click Failed Request Tracing Rules. In the Actions pane, click Add, choose All content, and set status codes to capture (e.g., 200 for all successful requests, or specific codes). Specify a path for trace files (default is %SystemDrive%\inetpub\logs\FailedReqLogFiles). Reproduce activity, then open the generated XML files in a browser to inspect request processing details.
  7. Review IIS logs for session-related activity. IIS logs are stored by default in %SystemDrive%\inetpub\logs\LogFiles. Open the relevant W3SVC log file in a text editor. Each request is a line; you can identify client IPs and timestamps. Note that IIS logs do not directly record session IDs unless your application logs them; they are useful for traffic analysis, not per-session tracking.
  8. Use Performance Monitor for ongoing session counts. In Performance Monitor, add counters such as Web Service > Current Connections (total connections) and ASP.NET Applications > Sessions Active (if ASP.NET session state is used). These give a real-time view and can be logged for historical trends.

Common Mistakes

  • Confusing connections with sessions. IIS Worker Processes shows requests and connections, not application-level sessions. If your app uses cookies or session state, those are tracked by the application, not IIS.
  • Expecting session IDs in IIS logs. By default, IIS logs do not include session identifiers. You would need custom logging in your application.
  • Leaving Failed Request Tracing enabled indefinitely. It generates many files and can fill disk space. Enable it only for troubleshooting and disable afterward.
  • Overlooking application pool recycling. Recycling an app pool ends all active sessions for that pool. Monitor recycling settings if sessions drop unexpectedly.
  • Using Performance Monitor counters without the correct instance. ASP.NET counters require the application to be running and may show multiple instances; pick the right one.

Tips

  • Use Worker Processes > View Current Requests for a quick snapshot of what is happening right now.
  • For long-term monitoring, set up Performance Monitor Data Collector Sets to log session counts over time.
  • If you need per-session tracking, implement logging in your application code (e.g., log session start and end with a unique ID).
  • Regularly review IIS logs for unusual patterns, but remember they are not real-time.
  • Keep Failed Request Tracing rules narrow to avoid performance overhead.

Troubleshooting

If Worker Processes shows no worker processes, ensure the application pool is started and the site is running. If View Current Requests is greyed out, you may need to select a specific worker process first. If Performance Monitor counters are missing, the ASP.NET performance counters may be disabled; run lodctr /R from an elevated command prompt to rebuild them (this is safe but requires a restart of Performance Monitor). If Failed Request Tracing produces no files, verify the trace path exists and that the rule is enabled at the site level. If sessions disappear unexpectedly, check application pool idle time-out and recycling settings in IIS Manager under Application Pools > Advanced Settings.

Frequently Asked Questions

Can I see a list of all active user sessions in IIS Manager?

Not directly. IIS Manager shows worker processes and current requests, but application-level sessions (like ASP.NET session state) are not listed. Use Performance Monitor counters or application logging for session counts.

What is the difference between a connection and a session in IIS?

A connection is a TCP-level link between a client and the server. A session is an application-level concept, often tracked via cookies or session state. IIS manages connections; sessions are managed by the application framework.

How do I monitor sessions for a specific website?

Select the site in IIS Manager, then use Failed Request Tracing for request-level detail, or Performance Monitor with counters scoped to the site's application pool. For session counts, rely on application-specific counters if available.

Does IIS log session IDs by default?

No. IIS logs record requests with fields like client IP, timestamp, and status code, but not session IDs. You would need to add custom logging in your application to capture session identifiers.

Can I monitor sessions in real time without third-party tools?

Yes, using Worker Processes > View Current Requests for active requests, and Performance Monitor for session counters. These are built into Windows Server and IIS.

Why do my session counts drop to zero periodically?

This is often caused by application pool recycling or idle time-out. Check the application pool's recycling settings and idle time-out in IIS Manager under Application Pools > Advanced Settings.