On my windows 2008 server I have a network share. I am logged on to the server with full administrator rights. I would like to know what users have active connections to that share.
How do I find that information?
On my windows 2008 server I have a network share. I am logged on to the server with full administrator rights. I would like to know what users have active connections to that share.
How do I find that information?
There are two ways to go about this that I know if. One is unreliable, but probably good enough for most scenarios. One is extensive, but hard to implement at any scale that exceeds a handful of user connections.
The Kinda-Sorta Way: Select System Tools >> Shared Folders >> Open Files to see what files are open on the file server. From there you can correlate the user accounts that have open files to the shares that they are connected to.
However, that can be insufficient. Don't believe me? Go into Computer Management and select System Tools >> Shared Folders >> Sessions to see who is connected. Then look at the # open files
column. Some sessions should have 0 open files. How do you know what share they are technically connected to? I'm glad you asked...
The Extensive but Hard to Scale Way: Perform net share [sharename]
on each share in question to get a list of the users that are connected to it. In my testing, even users that have no open file are listed.
You can also utilize the Share and Storage Manager administrative tool in Server 2008 and beyond instead of Computer Management. Find the share in the list of shares, and then in the action pane to the right click "Manage Sessions." You will see a list of sessions including those that have zero open files.
But... but... I want to find a specific user without querying each share! If you have a specific user that you want to track down, it appears that your only means of finding that information is to query each share and eyeball it to find the user you want. And by eyeball I mean piping output to findstr
or select-string
. One could extrapolate the workflow to a script that enumerates all available shares, queries for connected users, and searches the output for the user in question, but that appears to be an exercise for the reader and not something that Microsoft has included as a native feature.
This is a very old question, but the accepted answer skipped over one of the best ways to find the info. The GUI can show there are "connected clients" but not show those connections under "open files". In that case it requires using WMI to find who is connected to a share.
Here's the powershell command to see who is connected to a specific share and example output:
Get-WmiObject Win32_ServerConnection -ComputerName SERVER01 | Select-Object ShareName,UserName,ComputerName | Where-Object {$_.ShareName -eq "SHARENAME"}
Example output:
ShareName UserName ComputerName
--------- -------- ------------
SHARENAME user1 10.0.0.20
SHARENAME user2 10.0.0.30
SHARENAME user3 10.0.0.40
Computer Manager isn't accessed the same way as in previous versions. You do get the "Server Manager" when you right click Computer and select "manage". So, instead of that, just type in compmgmt.msc in the "search programs and files" field under start.
I do not think the answer(s) provided actually answers the question. If you are using Windows Server 2008 (NOT R2), and you right-click Computer and select Manage, then confirming the UAC message, the Server Manager MMC launches. Under Server Manager are the following items: Roles, Features, Diagnostics, Configuration and Storage. None of those five items seems to have share name connections available as an option, which is what the original question was asking. The EDIT addition to the answer was more useful, mentioning the Share and Storage Manager, but still does not seem to provide the answer. It provides a comprehensive list of share names and properties, but active connections does not show up here either. With Windows Server 2003, there used to be an OS utility which displayed servers, shares and connections, but I have not found it yet on WS2008. There was a third party utility I used to use named Hyena from Adkins Resource, which I believe is still being marketed, which did an excellent job of displaying all manner of information about virtually every aspect of a server's condition.