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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture open share sessions

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
US
I need to run a script that will capture open share sessions, can this be done with WMI?

Thanks,
-T

-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!

 
I don't believe you can with WMI, but may get some info using the WinNT provider.


Code:
Option Explicit

Dim objComputer : Set objComputer = GetObject("WinNT://servername/LanmanServer")
Dim objSession
For Each objSession In objComputer.Sessions
	WScript.Echo objSession.User
Next

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top