PC Review


Reply
Thread Tools Rate Thread

Detect Incoming Network Connections

 
 
=?Utf-8?B?bG9jYWxob3N0?=
Guest
Posts: n/a
 
      1st Feb 2004
I am looking for information on detecting the dis/connection of network resources. Anything about taking events from the MPR and AddConnectNotify() (I think that's right) OR WMI.

I think detecting outgoing network connections is pretty easy, but detecting incoming connections from remote machines to the local machine is another story....

Thanks.
 
Reply With Quote
 
 
 
 
Tian Min Huang
Guest
Posts: n/a
 
      2nd Feb 2004
Hello,

Thanks for your post. As I understand, you want to detect incoming
connections to your network shares. Please correct me if there is any
misunderstanding.

Based on my experience and research, you can use the
Win32_SessionConnection class in WMI. Please refer to the following MSDN
document and my VB Script sample:

Win32_SessionConnection
http://msdn.microsoft.com/library/de...us/wmisdk/wmi/
win32_sessionconnection.asp?frame=true

'-----------------------------------------VB Script------------------------
Set services = GetObject("WinMgmts:")

services.security_.privileges.addasstring "sedebugprivilege"

Set sink = WScript.CreateObject("WbemScripting.SWbemSink","SINK_")

services.ExecNotificationQueryAsync sink,"select * from
__InstanceCreationEvent WITHIN 1 where Targetinstance ISA
'Win32_ServerConnection'"
MsgBox "Wait for an event. " & VBCRLF & "Click OK to stop watching for
events!"

Sub SINK_OnObjectReady(objWbemObject, objAsyncContext)
Wscript.Echo " Share Name: " &
objWbemObject.TargetInstance.ShareName
Wscript.Echo " Computer : " &
objWbemObject.TargetInstance.ComputerName
Wscript.Echo " User : " &
objWbemObject.TargetInstance.UserName
Wscript.Echo
End Sub
'--------------------------------------end
of----------------------------------------

Please feel free to let me know if you have any problems or concerns.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
network establishing incoming connections (VPN) michael Windows XP Networking 1 6th Dec 2003 04:33 PM
>My Network Connections window does not have anything called Incoming Connections lhd_5113 Windows XP Networking 1 26th Nov 2003 08:08 AM
Why can't I find Incoming connections in My Network Connections? NormC Windows XP Networking 1 24th Nov 2003 02:57 AM
Multiple network connections setup (incoming & outgoing) stanley Microsoft Windows 2000 Networking 0 14th Nov 2003 05:45 AM
New Network Connection Hangs at Accept Incoming Connections Ed Fry Windows XP Networking 0 14th Oct 2003 03:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:37 AM.