How to get Rid of Windows Task Scheduler Password Issue with Amazon EC2 Instance

If you have tasks scheduled on a Windows 2003 or 2008 Server instance running on Amazon Elastic computing cloud (EC2) you may run into a problem. If your scheduled tasks are enabled (“run only if logged on” check box is ticked off) to be run even when an user is not logged on you have to set an user id and password so that the scheduler service use that credential to run your tasks even if you are not logged on. The “Run as” box stores the user id as MachineName\UserID. However, the problem is every time you reboot or restart your instance the default behavior of Amazon EC2 assigns a new machine name to your machine. The machine name is defaulted to the convention ip-PrivateIP. This cause the scheduler tasks to be assigned to invalid user credential and the tasks won’t execute even though they will be triggered.

Fortunately we can resolve this issue. The trick is Amazon allows us to configure a fixed machine name so that it wont change after restart. To do that go to “C:\Program Files\Amazon\Ec2ConfigService folder on your EC2 machine and run the EC2ConfigServiceSettings.exe. Tick off the check box under “Set Computer name”. Now change your computer name to your choice (edit My Computer properties) and restart your instance. When the machine is up, right click on one of your scheduled tasks and select properties. Edit the User name (to reflect the new machine name), click on Set Password and re-enter your password. All other tasks credential will be automatically updated and you are doen. Next time you reboot or restart your scheduled tasks will be executed properly without any password issue as your machine name won’t change.

Advertisements

4 thoughts on “How to get Rid of Windows Task Scheduler Password Issue with Amazon EC2 Instance

  1. I have an account on AWS and wish to know a few things about the ec2 instances. suppose we have a scheduled task which does a FTP backup of database everyday at some point of time. during this time if there are 2 ec2 instances running will the ftp backup happen in both instances or will it happen in just one instance?
    if incase it should happen in only one instance what should we do?
    or if it happens only in one instance how does it hapeen?
    please help me with this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s