Automate changing password for scheduled tasks on multiple servers

  • Thread starter Thread starter Marc
  • Start date Start date
M

Marc

I have several hundred servers in the same domain. Each server has the same
scheduled task. I need to change the service acct. password on each server.

After doing some searching and even talking to MS, I haven't found what I'm
looking for. Plus, I suck at scripting.

So..I'm going to use schtasks to write a batch file. However, schtasks only
shows how to do one server at a time. My thought is to write a call in the
script to point to a .txt file which has a list of all the servers I want to
change.

Can someone point me to an example of a script like this or offer up any
suggestions or samples.

I know this issue comes up a lot, yet there doesn't really seem to be
anything concrete. Thanks.
 
@echo off
if {%1}=={} @echo SchtasksPwd FileName&goto :EOF
if not exist %1 @echo SchtasksPwd %1 does not exist.&goto :EOF
setlocal
set file=%1
for /f "Tokens=*" %%s in ('type %file%') do (
schtasks /S %%s /TN "My Task: / RP NewPassWord
)
endlocal



I have several hundred servers in the same domain. Each server has the same
scheduled task. I need to change the service acct. password on each server.

After doing some searching and even talking to MS, I haven't found what I'm
looking for. Plus, I suck at scripting.

So..I'm going to use schtasks to write a batch file. However, schtasks only
shows how to do one server at a time. My thought is to write a call in the
script to point to a .txt file which has a list of all the servers I want to
change.

Can someone point me to an example of a script like this or offer up any
suggestions or samples.

I know this issue comes up a lot, yet there doesn't really seem to be
anything concrete. Thanks.

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Back
Top