Windows VB Script properties for network conections

Howdy,
I have a script that will run on 900+ servers and i am looking for a method/property whre i can determine if specific network connections are established for a new application we deployed. I have tried to use teh Win32_performattedData_TCPIP_TCP, Win32_Networkconnections, Win32_perfrawdata_TCPIP_TCP and Win32_Process to try and see if there were any properties that would give me this info, but it does not.

Does anyone know how i can pull in the port connection states into a script?
Thansk
Robert
rcabecaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Leo EikelmanDirector, IT and Business DevelopmentCommented:
Well you can try this article

http://www.ftponline.com/archives/premier/mgznarch/VBPJ/1999/09sep99/cb0999.pdf

You can also use netstat to see what connections are established.

See this article

http://www.sysinternals.com/Utilities/PsExec.html

Hope this helps a bit,

Leo
0
rcabecaAuthor Commented:
Thanks for the links, but i don't think i want to use a .dll if i can avoid it. Is there a way to enumerate the network connections by using "netstat" in a script and extracting the info from it?
rc
0
Leo EikelmanDirector, IT and Business DevelopmentCommented:
Check this out.  I didn't have time to check if this use the DLL or not, but if it doesn't then it can be a big help.

http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=30786&lngWId=1

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rcabecaAuthor Commented:
Thanks but this is a stand alone application that gives everything about all network resources. I tried to extract from it what i needed, but it does not gel with the vbs script that i am creating. My script is already 300 lines. I just need to know What object/property/method/class and it is driving me crazy trying to find it.
Thansk!
Robert
0
dasmcseCommented:
How about executing netstat within your script and redirect the output to a text file. Your script could then parse the text file for the info.
Set objWshShell = WScript.CreateObject("WScript.Shell")
strCMD =  objWSHShell.ExpandEnvironmentStrings("%COMSPEC%") & " /C "
objWshShell.run (strCMD & "netstat.exe" & " > c:\textfile.txt")

'now just read the data in the file.
0
vinnyd79Commented:
You could also use netstat without the need to redirect to a text file.
Dim oShell,oExec,sCmd,sRetVal

sCmd = "netstat"

Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sCmd)

Do
   sRetVal = oExec.StdOut.ReadLine()       
   if Instr(sRetVal,"ESTABLISHED") > 0 then
         MsgBox sRetVal
   end if
Loop While Not oExec.StdOut.AtEndOfStream

Set oExec = Nothing
Set oShell = Nothing
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rcabecaAuthor Commented:
Thanks Vinnyd79! You gave me just what i was looking for. Dasmcse, i would have used yours, but using the text file method and parsing was a bit more involved.
Thanks again all of you for providing your expertice.
Regards,
Robert Cabeca
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.