- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
09-03-2025 05:09 AM
Our Devx team want the developer to task kill WSL using -
Shell
taskkill -IM vmwp.exe -IM wsl.exe -IM wslhost.exe -IM wslservice.exe /F
The trouble is it requires admin to run. I wondered if it could be whitelisted as part of the WSL commands?
We lock own CMD and other high risk processes via an AAD group and very rarely give CMD as admin rights to devs anyway, so I was wondering how users can kill wsl2 running on windows 11 if it's possible to create a policy around the taskkill ? I don't believe giving users the ability to run task manager as Admin is either allowed or would do the job as that too is binded to an AAD group, but our cyber team would not want to go down this route either.
Devs are complaining they need to task kill wsl2 as for now they're forced to reboot the device when it becomes unresponsive.
We obviously have an Allow policy in place for wsl2 and a block policy in place for admin type aspects of wsl2 that developers are restricted from actioning, But this seems to be more of a general windows action
edit So possible just create a policy to allow for the termination of wslService ?
09-03-2025 05:38 AM
Why do they need to run task manager to kill the process? Task manager doesnt require admin rights to kill processes.
CTRL+ALT+DEL, click task manager, find wsl process, kill task.
You dont want to give task manager admin rights or they can create an elevated cmd prompt and other things but it doesnt need admin rights to kill processes.
09-03-2025 07:06 AM
Comes up with a typical error message - you need to be an administrator please run Task Manager as admin and we don't want to give users that ability just to end task wsl because it stops responding at times.
09-03-2025 08:09 AM
Looks like we've worked it out so rolling it out might create one for
AND Parameters is exactly "-IM wslservice.exe /F" (case insensitive) and may look to create a task kill for vmwp.exe too seems to work in our test environment.
09-03-2025 08:16 AM
Windows has never required admin rights to run task manager as far back as windows 3.1.
I do recall an instance of this happening in our environment where users were part of the network operators and it started causing windows to prompt for UAC.
By chance are your users in that security group? Have you tried putting the users creds in despite the admin prompt?
09-03-2025 08:52 AM
we lock down a lot of WSL actions and restrict them and CMD cannot be run as admin either, we've created the above policy I want to see if i can get the whole shebang working now - taskkill -IM vmwp.exe -IM wsl.exe -IM wslhost.exe -IM wslservice.exe /F
users here run task manager as normal of course, we actually lock it down via an AAD group along with other high risk processes as mentioned and you can't use task kill in cmd without admin rights , anyway now that we've created the EPM policy to allow this specific task kill for the wslservice it's working I want to branch out and see if EPM can kill all 3 processes.
09-05-2025 01:57 AM
ok it's working using both the commands as one argument - taskkill -IM vmwp.exe -IM wslservice.exe /F - Job done!
09-08-2025 06:56 AM
task manager doesnt require privileges to run, but if you are attempting to do something to a process running in a higher user context than your own, you will need to elevate your permissions to do so.
09-08-2025 06:58 AM
If I am following you correctly, you created a policy for taskkill.exe with those specific parameters as authorized for elevation?
So your user will open a regular CMD/PS shell and get their elevation by providing the right parms for taskkill?
09-08-2025 07:07 AM
That's correct we've created the epm policy and it's working when wsl shutdown doesn't help resolve a non-responsive behaviour. We've just tested and devs can now end the tasks using task kill. apologies you are right task manager doesn't need admin but we do restrict it's elevation via AAD permissions and didn't want to go down that route to end tasks the high privilege processes.
09-08-2025 07:12 AM
correct they get a EPM confirmation the parameters are elevated and able to be run, I guess though they have to run them from a separate non-elevated cmd/PS,
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!

