Automate changing password for scheduled tasks on multiple servers

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.
 
J

Jerold Schulman

@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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top