Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Killing processes on multiple machines remotely via powershell issue.

$
0
0

I am getting an error when trying to deploy the following code to multiple machines, see below.

Code:

$remote = new-pssession -computername teststation-2, teststation-1
import-pssession -session $remote -commandname *-process -prefix remote
get-remoteprocess -name fwt | stop-remoteprocess -force

Error:

Import-PSSession : Cannot convert 'System.Object[]' to the type 'System.Management.Automation.Runspaces.PSSession'
required by parameter 'Session'. Specified method is not supported.
At line:1 char:27
+ import-pssession -session $remote -commandname *-process -prefix remote
+                           ~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Import-PSSession], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.PowerShell.Commands.ImportPSSessionCommand


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>