Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## If the source scheduled task is set to run under an account other than that running PowerShell
- Get-ScheduledTask -TaskName "Source Task" | ForEach-Object { Register-ScheduledTask -InputObject $_ -TaskName "Copy Task" -TaskPath "\Guy" -Password "passwd" -User $_.Principal.UserId }
- ## If source scheduled task is to run only when the user running the PowerShell is logged on
- Get-ScheduledTask -TaskName "Source Task" | Register-ScheduledTask -TaskName "Copy Task" -TaskPath "\Guy"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement