How do I run a ps1 elevated as a scheduled job


how powershell script run administrator in scheduled job?

hi,

  1. on system task run from, open windows task scheduler. can found in start menu, under start > administrative tools.
  2. in task scheduler, select create task option under actions heading on right-hand side.
  3. enter name task, , give description (the description optional , not required).
  4. in general tab, go security options heading , specify user account task should run under. change settings task run if user logged in or not.
  5. 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.
  6. next, go actions tab , click new set action task run. set action start program.
  7. 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.
  8. next, set other desired settings in conditions , settings tabs. can set additional actions, such emailing administrator each time script run.
  9. once desired actions have been made (or added), click ok. task set, , ready run.

regards,

yan li

technet subscriber support

if technet subscription user , have feedback on our support quality, please send feedback here.


yan li

technet community support




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file