Solved

Concurrent connected user in SharePoint Site and Database

Posted on 2011-02-17
4
576 Views
Last Modified: 2012-05-11
Hi, I have 150+ Site Collection in SharePoint and each site collections having their own databases.
My query Is, How to find out total number and name of concurrent connected users in each SharePoint site collection?
I want both the ways means via SharePoint Site collection and via each database.
Is there any query to run on database or any code need to write for sites?
I am using SharePoint 2007 and SQL Server 2005.
Is it possible to get total number of users connected on SQL Server?
Kindly help.
0
Comment
Question by:Minesh Shah
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:lkammer
ID: 34925001
Hi,

You can select a count of the number of connected users to each database within an instance of SQL Server using something like this.

select count(distinct loginame), DB_NAME(dbid) from master..sysprocesses
Group by DB_NAME(dbid)
Having db_name(dbid) not in ('master', 'msdb')
order by db_name(dbid)

Open in new window


To obtain a list of usernames and the database(s) they are connected to

select loginame, DB_NAME(dbid) from master..sysprocesses
Group by loginame, DB_NAME(dbid)
Having db_name(dbid) not in ('master', 'msdb')
order by db_name(dbid)

Open in new window


Hope this helps.

Cheers

Leon
0
 
LVL 10

Author Comment

by:Minesh Shah
ID: 34931654
Sorry, what I want in result above queries are not giving those results.
I think it’s showing the Id by which the SQL Server is authenticated, means admin id.
I want user’s id’s that are login currently in sites.
Kindly help
0
 
LVL 1

Accepted Solution

by:
lkammer earned 500 total points
ID: 34942853
Hi,
Sorry for not getting back sooner.

You are correct, this will display logins authenticated against the SQL Server instance and database.

You will need to use a DelegateControl to log users' activity on the sharepoint site.

You could try this
http://blog.furuknap.net/find-number-of-users-currently-logged-on-to-a-sharepoint-site

it explains how to create a solution to determine this.
I have not tried this with 2007.

Cheers

Leon

0
 
LVL 10

Author Closing Comment

by:Minesh Shah
ID: 35035283
ok
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now