WMI can do that for you.
Below is an example. It takes ages to complete but it's just a quick and dirty one.

 Code:
$wmiColl = GetObject("WinMgmts:root/cimv2").ExecQuery("Select * FROM Win32_NetworkConnection")

For Each $wmiObj in $wmiColl
	? $wmiObj.ConnectionState
Next
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.