Luis Diaz
asked on
Powershell: disable enable windows task of windows scheduler
Hello experts,
I have access to different VM's. I was wondering if there a way through powershell to disable the various windows tasks of windows scheduler by reporting the IPs in a txt file.
Thank you in advance for your help.
I have access to different VM's. I was wondering if there a way through powershell to disable the various windows tasks of windows scheduler by reporting the IPs in a txt file.
Thank you in advance for your help.
ASKER
Thank you for your help. Prior to run this I would like to make sure that -scriptblock is the argument, isn't?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much. I will test it and keep you informed.
ASKER
I tested and it works!
I was having some issues by finding line 19 to disable for real but finally I realize that line to uncomment is the following:
$null = $task | Disable-ScheduledTask -ErrorAction Stop
ASKER
Last question, f I want to use the script to apply the opposite approach (enable windows tasks), could you please let me know which are the lines to modify?
Thank you for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Noted, I will test it and keep you informed.
ASKER
I tested disable and enables tasks and they work!
Thank you very much for your help!
Thank you very much for your help!
Open in new window
I think that should work, it'll rely on WinRM being enabled.
Regards