WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: dblaze1 on April 25, 2014, 01:22:35 PM

Title: Change the password on scheduled tasks
Post by: dblaze1 on April 25, 2014, 01:22:35 PM
Our new security policy states we much change the password of scheduled tasks more frequently than we currently do.  All scheduled tasks run under a couple of different domain accounts.  Is there a way to do this via Winbatch?  We have 2 primary servers that run all scheduled tasks - one is Windows 2003 server and the other is Windows 2012 server.  If we had to do it by hand, it would only take a half hour or so but it would be nice to automate it.

Thanks,
Doug 
Title: Re: Change the password on scheduled tasks
Post by: Deana on April 25, 2014, 03:24:21 PM
Maybe using the TaskScheduler COM object?:

Reference:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/Task~Scheduler
http://msdn.microsoft.com/en-us/library/windows/desktop/aa382079(v=vs.85).aspx

However it appears that you can only specify the password when creating a new task....
Title: Re: Change the password on scheduled tasks
Post by: DAG_P6 on April 30, 2014, 01:15:50 AM
A few months ago, I had a similar requirement, for which I applied the same general approach. Although I implemented it in C#, it used the Task Scheduler COM object through COM Interop. On Windows XP, it worked splendidly. However, I ran into many issues on Windows 7, and took a different approach, using schtasks.exe and a XML file that contained all of my settings.

There are two issues at play.


Based on experience with XP, Server 2003, Windows 7, and Windows Server 2012, I would expect anything that was an issue for Windows 7 to be an issue for Server 2012, and that anything that applies to XP is generally, though not always, equally applicable to Windows Server 2003.