2 ms·
Thanks, but is there a way to do that without having access to the computer or having to try to walk the user through setting up a task in task scheduler? The u
by coderintherye 4y ago
Thanks, but is there a way to do that without having access to the computer or having to try to walk the user through setting up a task in task scheduler? The users in this use case can do something as simple as download and install a .exe program, but there is no way they would manage setting something up in Task Scheduler.
I've used Task Scheduler via remote desktop (which itself was a pain to get them able to set up) to set things up for them before but that is not scalable.
- cshokie 4y agoYes that is what the PowerShell module is for. You can script things like ‘New-ScheduledTask’ and give it the appropriate parameters. The only thing the user would need to do is run the script. That could create the scheduled tasks and drop the “real” scripts where the scheduled tasks can find them. It can be helpful to send along a tuple of {PowerShell, cmd} where cmd just forwards arguments to PowerShell. That way you can run “PowerShell -ExecutionPolicy Bypass myscript.ps1 %*” and avoid the pain of changing the system-wide security policy for PowerShell scripts. (Unsigned PowerShell scripts are blocked by default).