How do I run a ps1 elevated as a scheduled job
how powershell script run administrator in scheduled job?
hi,
- on system task run from, open windows task scheduler. can found in start menu, under start > administrative tools.
- in task scheduler, select create task option under actions heading on right-hand side.
- enter name task, , give description (the description optional , not required).
- in general tab, go security options heading , specify user account task should run under. change settings task run if user logged in or not.
- next, select triggers tab, , click new add new trigger scheduled task. new task should use on schedule option. start date can set desired time, , frequency , duration of task can set based on specific needs. click ok when desired settings entered.
- next, go actions tab , click new set action task run. set action start program.
- in program/script box enter "powershell."in add arguments (optional) box enter value ".then, in start in (optional) box, add location of folder contains powershell script. in example, script in folder called "script" off root c: drive. note: location used in start in box used storing scheduled task run times, job history copies, , additional logging may occur. click ok when desired settings made.
- next, set other desired settings in conditions , settings tabs. can set additional actions, such emailing administrator each time script run.
- once desired actions have been made (or added), click ok. task set, , ready run.
regards,
yan li
if technet subscription user , have feedback on our support quality, please send feedback here.
yan li
technet community support
Windows Server > Windows PowerShell
Comments
Post a Comment