Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Concurrent connected user in SharePoint Site and Database

Posted on 2011-02-17
4
Medium Priority
?
595 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

604 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