Find the Number of Users Currently Connected to SharePoint Site

Had to perform an unplanned IIS Reset to fix an issue in production SharePoint Farm. But executing IISReset breaks ongoing user sessions and give "Service Unavailable" error message, isn't it? Wouldn't it be a good idea to find the No. of users currently connected with the SharePoint site and do the IISReset for a minimal impact? Sure!

How to find how many users connected with SharePoint sites? use Performance Monitor!
  • Go to Start >> Run >> Type "Perfmon", to fire up Performance Monitor.
  • Click on "Performance Monitor" , Right click "Add Counters" in Graph windowsharepoint how many users connected
  • Under the available Counters, Pick "Web Service" expand the node and select "Current Connections"
  • Under "Instances of Selected object" You can either select "Total" or pick a particular web applicationFind the number of users Currently Connected to SharePoint Site
  • Click on Add button to add the selected counter, and click "OK" button
Now the graph will show the how many users connected to your SharePoint Site(s).
sharepoint number of users connected
Please not, this gives only the no of user sessions currently ongoing. But not the one already completed (Doesn't count the users already opened the site and left it idle!) There are possibilities that users may hit the SharePoint URL meanwhile and receive "Service Unavailable" message since IIS is reset!

PowerShell to get current number of users connected:
We can also use PowerShell to get number of users connected:
$servername = "Cres-SPWFE01"
Get-Counter -Counter 'web service(_total)\current connections' -ComputerName $servername
This gets you the number of users connected with all web sites in the server.

Lets get number of users connected for a particular web site:
$servername = "Cres-SPWFE01, Cres-SPWFE02, Cres-SPWFE03"
$WebSiteName="Intranet Portal" #Web site name in IIS
Get-Counter -Counter "web service($WebSiteName)\current connections" -ComputerName $ServerNames

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.