My friends asked me simple question: How to stop (terminate) processes on a remote server?
Of course you can use:
Invoke-Command -ComputerName RemoteServer
Invoke-Command -Session $existingSessionToRemoteServer
But in this case my friends had established CIM session in their script. I wrote a few simple examples how to stop process using WMI and CIM and if you add -ComputerName (for Get-WmiObject) or -CimSession (for Get-CimInstance) then you can do it on a remote server.
WMI on …Read More