Skip to content

Instantly share code, notes, and snippets.

@kan6004
Created January 5, 2015 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kan6004/7b460021090bbd458036 to your computer and use it in GitHub Desktop.
Save kan6004/7b460021090bbd458036 to your computer and use it in GitHub Desktop.
2015.1.5 samplecode4
$taskname = "test"
$execuser = "<domain>\<execute user>"
$execpass = "execute user password"
Invoke-Command -Session $s -Scriptblock{
Register-ScheduledTask -TaskPath "\" -TaskName $args[0] -User $args[1] -Password $args[2] -RunLevel Highest -Trigger $trigger -Action $action
} -ArgumentList $taskname, $execuser, $execpass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment