How to kill a WAC initiated process

ananda vardhana 21 Reputation points
2020-08-22T14:05:35.107+00:00

Hello,

I start Windows Admin Center (WAC) and attach to a remote system. There I open a Power Shell and start my application. That application runs for ever in an endless loop. Now I close my WAC so along with that the PS windows also gets closed BUT the application keeps running. What I want is, when I kill the WAC my application also should die. When WAC exits my application becomes a Zombie process. How can I prevent this Zombie process? Please advice.

If you do a Remote Desktop(RDP) to that system and open a PS window and run the same command and then close the PS window, the program dies along with the PS window. Question is via WAC how to get the same affect?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,546 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andy YOU 3,076 Reputation points
    2020-08-25T07:09:13.24+00:00

    1.Question is via WAC how to get the same affect?
    I think we can try to create a task scheduler on remote server to stop the expected app when your admin account disconnect from the remote server(or create task scheduler domain policy to applied to your expected remote servers or using task scheduler in WAC)?

    after the task scheduler create successfully, we can click "disconnect" in WAC like picture1 and check the result.
    20010-77.png
    2.the example for .bat file to kill procmon.exe
    taskkill /F /T /IM procmon.exe

    taskkill
    https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/taskkill

    How to Configure a Scheduled Task Item using Group Policy
    https://www.faqforge.com/windows-server-2016/configure-scheduled-task-item-using-group-policy/

    create a task scheduler option:

    20050-10.png20136-12.png20137-14.png

    20067-15.png

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. ananda vardhana 21 Reputation points
    2020-08-25T18:25:49.037+00:00

    Thank you @Andy YOU
    Good options I will give it a try
    regards
    ananda


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.