Warning: this post contains a lot of personal opinion.
I showed that there were a number of ways of “pinging” a remote machine:
- Using Ping
- Using WMI
- Using .NET
- Using cmdlet
In many cases there isn’t a cmdlet available to do the job we want (we will never see a cmdlet to perform every possible job) but we might be able to find some .NET, WMI or COM class that we can use to do the job.
In many cases there is only one way to get the job done but a lot of the time we may find multiple possibilities. A frequent question is along the lines of “Which is better WMI or .NET” – add COM where appropriate.
The simple answer is all of them. As an admin my objective is to get the job done. I’ll use the tool that gives me the answer. I regularly use WMI, .NET and COM. If I find a script on the Internet to solve me problem I will use it.
PowerShell makes it easy to work with .NET, WMI and COM. Don’t agonise over which to use – solve your original problem.