Solved

Concurrent connected user in SharePoint Site and Database

Posted on 2011-02-17
4
586 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

837 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