Powershell : Remote Internet Connection check

2.9k Views Asked by At

Is there any way to check, if remote computer has internet connection.

I want to check internet connection status before calling COM on remote server.

"[activator]::CreateInstance([type]::GetTypeFromProgID("Microsoft.Update.Session","$comp"))" 

Thx

1

There are 1 best solutions below

0
On

One idea that comes in mind is to issue a ping command (from your machine) where the source of the ping is the remote computer and the target could be any valid Internet (ip) address (source http://www.powershellmagazine.com/2012/08/26/pstip-a-hidden-gem-of-the-test-connection-cmdlet/):

[bool](Test-Connection -Source RemoteComputer -ComputerName google.com -Count 1 -ErrorAction SilentlyContinue)