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

Share Session Information

Status
Not open for further replies.

djtech2k

MIS
Jul 24, 2003
1,097
US
I need to create reports that shows the data from the page if you go to the "Share Sessions" page off of computer management in Windows 2000. I found win32_serverconnection in wmi for win 2003, but cannot find something like it in 2000.

Any ideas on where I can find similar data in windows 2000?
 
Maybe the WinNT provider...

Code:
Option Explicit

Dim objLM : Set objLM = GetObject("WinNT://SERVERNAME/LanmanServer")
Dim colSessions : Set colSessions = objLM.Sessions
Dim objSession
For Each objSession In colSessions
	' search for IADsSession Interface for additional properties
	WScript.Echo objSession.User
Next

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Thanks dm. I am working on that but thus far I cannot seem to find the properties that I need to report from the properties that are allowed plus the data returned does not make sense in some cases.

Here is what I need and what I get from WMI in 2k3:

objItem.ShareName
objItem.UserName
objItem.NumberofFiles
objItem.ActiveTime
objItem.NumberOfUsers
objItem.Status

When I try the iads method, I get a number when trying to echo out the computer name and there only seem to be like 3 properties available. Any ideas?
 
You may have to look at other ADSI objects of WinNT to see if they can provide the information you are after or parts of it....you may need to use a few to get the information.... or they may not provide the information at all.

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
You could be right. I noticed that the command "net session" returns a lot of it, but not quite all. If you look at the shared folders sessions screen, its all there. I just need it reported out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top