jonathanx
asked on
who connected to my machine script
im thinking of making a script that display the users connected to my pc (im on a network).
i was able to this using visual basic , using netsessionenum function.
my question is how to i implement this using visual basic script.
thanx.
i was able to this using visual basic , using netsessionenum function.
my question is how to i implement this using visual basic script.
thanx.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi:
I think net use command prompt will give details. An API equivalent in VB should help you out.
deepak
I think net use command prompt will give details. An API equivalent in VB should help you out.
deepak
ASKER
i've copy & paste both script into a notepad and saved it as a .vbs. i double clicked it and nothing happen.i tried both and nothing happen.
should i change anything in the code,?
thanks guys.
should i change anything in the code,?
thanks guys.
ASKER
hahaha.. ok my fault. noting happens bcoz nobody was connected to my pc. Both script works fine. :P
haha.. thanx!
haha.. thanx!
as an alternative, try the following, to enumerate who's connected to your computer's shares.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("S
For Each objItem in colItems
Wscript.Echo "ActiveTime: " & objItem.ActiveTime
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "ComputerName: " & objItem.ComputerName
Wscript.Echo "ConnectionID: " & objItem.ConnectionID
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "InstallDate: " & objItem.InstallDate
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "NumberOfFiles: " & objItem.NumberOfFiles
Wscript.Echo "NumberOfUsers: " & objItem.NumberOfUsers
Wscript.Echo "ShareName: " & objItem.ShareName
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo "UserName: " & objItem.UserName
Next