Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Monitor share access

Reply
 
Old 06-11-2008   #1 (permalink)
Rob


 
 

Monitor share access

Hi

I've been looking for this, and would have thought it easy, but am still
empty handed.

On a small network I'd like to see when someone is accessing one of my
shares, almost all of which are readonly. All the machines use XP, and we
use simple file sharing.

Any help would be great

Rob



My System SpecsSystem Spec
Old 06-11-2008   #2 (permalink)
Richard Mueller [MVP]


 
 

Re: Monitor share access

Rob wrote:
Quote:

>
> I've been looking for this, and would have thought it easy, but am still
> empty handed.
>
> On a small network I'd like to see when someone is accessing one of my
> shares, almost all of which are readonly. All the machines use XP, and we
> use simple file sharing.
>
> Any help would be great
You can bind to a specific share ard retrieve the value of CurrentUserCount.
For example

Set objMyShare = GetObject("WinNT://MyComputer/LanmanServer/MyShare")
Wscript.Echo "Current users: " & objMyShare.CurrentUserCount

You can also display informaton on user sessions on the computer:

Set objServer = GetObject("WinNT://MyComputer/LanmanServer")
For Each objSession In objServer.Sessions
Wscript.Echo "Session: " & objSession.Name _
& vbCrLf & " User: " & objSesion.User _
& vbCrLf & " Computer: " & objSession.Computer _
& vbCrLf & " Connect Time: " & objSession.ConnectTime _
& vbCrLf & " Idle Time: " & objSession.IdleTime
Next

Finally, you can display information on open resources:

Set objServer = GetObject("WinNT://MyComputer/LanmanServer")
For Each objResource In objServer.Resources
Wscript.Echo "ResourceID: " & objResource.Name _
& vbCrLf & " Path: " & objResource.Path _
& vbCrLf & " User: " & objResource.User _
& vbCrLf & " Lock Count: " & objResource.LockCount
Next

You can play with the above to see if it gives you what you want. There is
nothing to trigger an alert when someone accesses resources on the computer.
You need to run a script to see if anything is happening at that moment.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Issue with print monitor software not working on a share Vista networking & sharing
cannot access xp share Vista networking & sharing
access share on XP box Vista networking & sharing
Cannot access share on XP PC Vista networking & sharing
Vista "Access Is Denied" Trying to Access Network Share Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46