Find Out If A Machine Is Connected To The Internet

by Feb 3, 2011

Ever wondered if a machine was connected to the Internet? Here is how you can find out:

$networkListManager = [Activator]::
CreateInstance([Type]::
GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
$connections = $networkListManager.GetNetworkConnections()
$connections | ForEach-Object {$_.isConnectedToInternet}

Twitter This Tip!
ReTweet this Tip!