How to update multiple Task Scheduler user passwords with PowerShell


Table Of Contents

Add a header to begin generating the table of contents

If you have a ton of Windows tasks in your task scheduler, and you need to change the password to the account that they run under, it can be a painful experience to change the passwords on each task one at a time. This PS Script can help with that.

I found this little gem on stackoverflow.com a while back while trying to help someone with this problem. The details where spread out through the posts, so I put the pieces together here to save those that find this the hassle of replacing the depreciated methods, etc., putting it together, and making it work.

This script will change the password for the specified user on every task instance of that specified user. No guarantees are implied here. Remember to have a backup of your system, always.


$NewTaskCreds = Get-Credential
Get-ScheduledTask | Where-Object { $_.Principal.UserId -eq $NewTaskCreds.UserName } | Set-ScheduledTask -User $NewTaskCreds.UserName -Password $NewTaskCreds.GetNetworkCredential().Password

(Visited 6,991 times, 1 visits today)

Disclaimer

Technoogies.com has made every effort to ensure that the information provided is correct but is not advice. Technoogies will not accept any responsibility or liability for any errors or omissions. Technoogies Authors do not vouch for third party sites. Visit third party sites at your own risk. Technoogies is not directly partnered with any vendor or third party. This website uses cookies only for analytics and basic website functions. Technoogies does not accept any liability that might arise from accessing the data presented on this site. Links to internal pages promotes the content of Technoogies. This article does not constitute legal advice.

Disclosure of Affiliations

Technoogies.com is affiliated with Google, Amazon, and other advertisers. Running this site costs money and if it can’t sustain itself through ad's, it’ll go bye-bye. Please help me to keep that from happening with your patronage of ads that are of interest to you.

Technical Nuggets of Knowledge
Scroll to Top