Error remote comand

This topic contains 4 replies, has 3 voices, and was last updated by  Radu 1 week ago.

  • Author
    Posts
  • #100503

    Radu
    Participant

    Hi,

    If I am trying:

    Get-Process -c $comp -name chro* | Stop-Process
    I have the following error:

    "feature is not supported in remote machine"

    If I use the command Get-Service with pipeline for services it's working. Last week I was able to stop a process with this command, but now I have this error for all the computers.

    I tried also with Get-WmiObject -Class Win32_Process:

    (Gwmi Win32_Process -c $comp | ? {$_.ProcessName -like "*chr*"}).Terminate()
    but it's not working, and I don't have errors.

    I cannot use Invoke-Command because PSremoting is disabled.

  • #100507

    Alex Aymonier
    Participant

    Can you run this locally on your machine? Can you log into that remote machine and do it there?

    • #100519

      Radu
      Participant

      @alex Yes, loccaly get-process chr* | stop-process it's working on both machine.
      I will try with WMI class locally also to check.
      I need this command for some scripts, and i don't want to use psexec to much. PSRemoting is disable.

    • #100531

      Matt
      Participant

      Try Below

      $Process = ""
      
      $Killme = Get-WmiObject win32_Process -ComputerName ACHRCNB0900X409 -Filter "name='$Process'"
      
      IF(!($process -eq "")){
      
          $Killme.terminate()
      
      }
      
    • #100647

      Radu
      Participant

      @matt i tried, but it's not working. The process is still running.

You must be logged in to reply to this topic.