1

GD,

I have used the following command succesfully in Server 2012 R2, but it does not work in Server 2016:

runas /noprofile /user:DOMAIN\administrator "taskkill /f /im name_of_service.exe"

Anybody any idea what has changed in Server 2016?

If I want to close something like notepad.exe that works. But not spoolsv.exe for example

runas /noprofile /user:DOMAIN\administrator "taskkill /im spoolsv.exe /f"

Whereas when I run: taskkill /im spoolsv.exe /f That does work.

So it seems to be the combination of Server 2016, runas and taskkill what has changed.

No error message to be found anywhere.

Robert W
  • 11
  • 2
  • I tried it and it worked. Probably help if any errors/results were included. – Greg Askew Jan 31 '19 at 12:15
  • You tried it in Server 2016, and it worked? I would of course post errors, but there are none. Not displayed in the CMD window or in Windows Event Log. I know it doesn't work because I can see the process not being closed. – Robert W Jan 31 '19 at 12:39
  • Put `cmd /k ` before taskkill. If you are killing a service, my guess would be it is restarting due to recovery action. – Greg Askew Jan 31 '19 at 14:58
  • No this is not the case. I also have taskmanager open so I can see in server 2012 it's actually closing/ not in the list anymore, this does not happen in server 2016. – Robert W Jan 31 '19 at 15:34

1 Answers1

0

Admin Approval Mode was Enabled in a GPO. So I disabled that and after that everything worked again.

Robert W
  • 11
  • 2