Re: How to get the list of open files on network
- From: "Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 9 Apr 2006 11:34:12 -0500
You can bind to LanmanServer on the local computer:
Set objDC = GetObject("WinNT://MyServer/LanmanServer")
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
"Nir Tal" <NirTal@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:941D1396-6500-4EFA-B7AA-9F93BFAAE0BD@xxxxxxxxxxxxxxxx
how do i do it without a domain ex. a local computer?
"Richard Mueller" wrote:
Nir Tal wrote:
Under computer managment >> shared folders >> sessions or Open files i
can
see whos useing my files.
how can i get this list via Code????
Hi,
The sessions have a tendenancy to come and go, depending on activity, but
you can enumerate them with VBScript code similar to:
Option Explicit
Dim objDC, objSession
Set objDC = GetObject("WinNT://MyDomain/MyServer/LanmanServer")
For Each objSession In objDC.Sessions
Wscript.Echo "Session: " & objSession.Name _
& vbCrLf & " User: " & objSession.User _
& vbCrLf & " Computer: " & objSession.Computer _
& vbCrLf & " Connect Time: " & objSession.ConnectTime _
& vbCrLf & " Idle Time: " & objSession.IdleTime
Next
Set objSession = Nothing
Set objDC = Nothing
Wscript.Echo "Done"
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
.
- References:
- Re: How to get the list of open files on network
- From: Richard Mueller
- Re: How to get the list of open files on network
- Prev by Date: Re: Splitting strings
- Next by Date: Re: [MSH] System.Guid output is not formatted as a readable string (bug/suggestion filed)
- Previous by thread: Re: How to get the list of open files on network
- Next by thread: Re: username and password not applying
- Index(es):
Relevant Pages
|
Loading