locked
Change Passwords for schedule tasks on multiple computers RRS feed

  • Question

  • I am trying to change passwords for schedule tasks using a powershell script shown below. The script works fine but with this script everytime we change the password we will have to go edit the script to add the new password for all these 5 tasks instead I am trying to find if there is a way to do supply the password only once at a prompt and then it will go in and change the password for all tasks on all servers without me entering the passwords manually in the script as is the case now also don't want to store the password in the script.Appreciate your help!



    • Edited by sk_786 Wednesday, July 11, 2018 8:40 PM security
    Tuesday, July 10, 2018 6:57 PM

Answers

All replies

  • https://docs.microsoft.com/en-us/windows/desktop/taskschd/schtasks

    I got you booboo

    you are specifying the remote server you want to change but you fail to auth to that server. /ru and /rp are the creds the task will run under.

    many task will also require :

    /RL level

    A value that sets the run level for the task. Valid values are LIMITED and HIGHEST.

    Windows XP and Windows Server 2003: This option is not available.

    • Edited by The Grim Tuesday, July 10, 2018 7:07 PM
    Tuesday, July 10, 2018 7:05 PM
  • I wrote about this a while back.

    IT Pro Today - Updating a Scheduled Task's Credentials

    The script is available here:

    https://gist.github.com/Bill-Stewart/8bb7a1f0675c4f54baf24e1a7ca94d0e


    -- Bill Stewart [Bill_Stewart]



    Tuesday, July 10, 2018 7:06 PM
  • if there is a way to do supply the password only once at a prompt and then it will go in and change the password for all tasks on all servers without me entering the passwords manually in the script as is the case now also don't want to store the password in the script.Appreciate your help!


    Just make the password a variable.


    \_(ツ)_/

    Tuesday, July 10, 2018 7:13 PM
  • Thanks Bill,

    Can you suggest a way to incorporate this into my script?Appreciate your time.

    I just want to be prompted for username and password once and use that input for all other scheduled tasks passwords to be changed on all servers.

    Tuesday, July 10, 2018 9:41 PM
  • The article should provide sufficient guidance. (It's really difficult to provide specific hand-holding from a web forum, unfortunately.)

    -- Bill Stewart [Bill_Stewart]

    Wednesday, July 11, 2018 2:58 PM