I need to find some method for disabling a scheduled task on a remote machine and waiting until that task has stopped executing if it happens to be running at the moment. I'd like to do this through WMIC if possible. This will be integrated into a larger batch process.
This is as far as I've gotten:
> wmic /node:%SERVER_NAME% /namespace:\\root\cimv2 path Win32_ScheduledJob
But this just returns:
No Instance(s) Available.
So I'm not sure if I'm doing anything wrong or if maybe I need to configure something on the server.