Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Users connected to a share 1

Status
Not open for further replies.

Beard36

Programmer
Sep 4, 2003
69
GB
I'd like to have a script that can both display the number of users that are currently connected to a share (eg. when you disconnect a file share and it comes up with a message along the lines of "are you sure - there are currently 3 users connected") and then I'd like to be able to list the usernames.

Is this possible? I've been having a look round, but no joy.
Any guidance would be much appreciated.

Cheers.
 
Oh yeah. But is there a way to do this remotely? ie. get a report about the shares on a computer other than the one the script is running on?

Thanks for your time & advice.
 
you may want to try psfile.exe. It can be downloaded from sysinternals.com. It is a local and remote network file lister
 
Hello all,

Fairly standard LanmanServer service goes like this.
Code:
set fsvc=GetObject("WinNT://computer/LanmanServer")
fsvc.Filter=Array("FileShare")
for each fshare in fsvc
    with fshare
        wscript.echo _
            "Share Name: " & .Name & vbcrlf & _
            "Description: " & .Description & vbcrlf & _
            "Path: " & .path & vbcrlf & _
            "current connected: " & .CurrentUserCount & vbcrlf & _
            "Max connections allowed: " & .MaxUserCount
    end with
next
set fsvc=nothing
regards - tsuji
 
good post tsuji, i think it might be worth a FAQ, seem to recall it coming up before
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top