There is a .NET method used for retrieving TCP and UDP connection information as listed below:
[Net.NetworkInformation.IPGlobalProperties]::GetIPGlobalProperties().GetActiveTcpConnections()
[Net.NetworkInformation.IPGlobalProperties]::GetIPGlobalProperties().GetActiveUdpConnections()
I was curious if there is a way to do the same via VBScript? I would like to have the output of all of the connections, similar to a netstat -an output, returned in a VBscript that I am using for network documentation. If this is possible via a WMI query, I would be interested in that as well.
Here are some links for reference to the .Net methods listed: