Check sessions





-5
Date Submitted Sat. Apr. 15th, 2006 2:56 AM
Revision 1 of 1
Syntax Master dannyboy
Tags connect | VBSCRIPT
Comments 0 comments
check server sessions

Dim adsComputer, adsSession, strOutput

strOutput = ""

Set adsComputer = GetObject("WinNT://picasso/ntspicasso/LanManServer")

For Each adsSession In adsComputer.Sessions
        strOutput = strOutput & "Session Object Name     : " & adsSession.Name & vbCrLf
        strOutput = strOutput & "Client Computer Name    : " & adsSession.Computer & vbCrLf
        strOutput = strOutput & "Seconds connected       : " & adsSession.ConnectTime & vbCrLf
        strOutput = strOutput & "Seconds idle            : " & adsSession.IdleTime & vbCrLf
        strOutput = strOutput & "Connected User          : " & adsSession.User & vbCrLf
        strOutput = strOutput & vbCrLf
Next

WScript.Echo strOutput
 

Comments

There are currently no comments for this snippet.

Voting