Using the LanmanServer container exposed by the WinNT provider you can get information about shares (Name, Description, CurrentUserCount, MaxUserCount, and Path) and also session information (that includes the user), but I see no way to tell
which user is accessing which share. For example:
' Specify NetBIOS names of domain and computer.
strDomain = "MyDomain"
strComputer = "West223"
' Specify a share on the computer.
strShare = "MyShare"
' Bind to the share.
Set objShare = GetObject("WinNT://" & strDomain & "/" & strComputer & "/LanmanServer/" & strShare & ",fileshare")
Wscript.Echo "Share Name: " & objShare.Name
Wscript.Echo "Description: " & objShare.Description
Wscript.Echo "Path: " & objShare.Path
Wscript.Echo "MaxUserCount: " & objShare.MaxUserCount
Wscript.Echo "CurrentUserCount" " & objShare.CurrentUserCount
Set objFileService = GetObject("WinNT://" & strDomain & "/" & strComputer & "/LanmanServer")
For Each objSession in objFileService.Sessions
Wscript.Echo "Session Name: " & objSession.Name
Wscript.Echo " Computer: " & objSession.Computer
Wscript.Echo " User: " & objSession.User
Next
Richard Mueller