I’m feeding an Invoke-Command a list of servers to run a script and return results. Everything works as I want, except for servers that it cannot connect to (obviously).
What I would like is to have the script also output a list of the computers that were unable to successfully connect with the Invoke-Command, so I know which ones were offline and not part of the results (instead of just seeing the default error messages).
The important part of the code currently looks something like this:
$Results = @()
$Results = invoke-command -computername ‘PC1’,‘PC2’,‘OfflinePC’,‘PC3’,‘PC4’