Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I wish to know the possible ways to find out the count of all currently logged in users across all the SharePoint site collections in a farm.

For example (users logged into sites)

John - http://webapp1/sites/portal

Jack - http://webapp1/sites/portal

John - http://webapp1/sites/corporate

Derek - http://webapp2:90/sites/dashboard

The output desired from a program/script is it can give me the total unique visitors with active sessions across all these site collections

3


Things I have tried so far

IIS Log Parser way
http://salaudeen.blogspot.in/2011/01/using-log-parser-with-sharepoint.html

SQL Queries to the content database of the web application

SELECT COUNT(DISTINCT tp_login) AS USERCOUNT
FROM [WSS_Content_Databasename].[dbo].[UserInfo]
WHERE tp_ExternalTokenLastUpdated > '2012-03-31'
AND tp_Token != 'NULL'

Both the above ways are bound by limitations like parsing IIS logs from multiple WFEs and manually querying all content databases becomes an overhead.Additionally I am not really sure if either of them are the right approach for achieving this.

I read a good number of webpages from Google and the only definite conclusion I have is there are no out of the box way in SharePoint to achieve this. Please somebody guide me here.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Log Parsing or web analytics in general will give you good historical info, but generally not good real-time information.

Querying the content database should absolutely not be done. Microsoft says that doing so will void any warranty or support. Anyone that has poked around with SharePoint enough will know that trying it absolutely does create problems within the environment.

If you have a need for real-time info then you will either need add some custom code to the master page that can write or report out active session information to a centralized source or you will need to interface with the standard Windows Management Instrumentation (WMI) counters which include the ability to get the current session count information for a given web server or break it down for each web application.

My preference would be to use the WMI in nearly all cases.

share|improve this answer

Take a look at http://spcurrentusers.codeplex.com which may serve as a starting point. It's my solution, in case you're wondering :-)

.b

share|improve this answer
    
Was about to suggest that :-D. And combination of your solution and powershell to query the fields / lists used by your solution would result in an overview that could be grouped per site collection, per web application. –  Colin Mar 31 '12 at 23:13
    
awesome solution :) –  Falak Mahmood Jun 5 '12 at 9:58
    
Does this work with SharePoint 2010? Have you thought about recreating this solution with VS 2010? –  Bob Oct 29 '13 at 13:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.