Retry setting AD password up to 5 times with a one second delay between each attempt; add more detail to 'invalid application' state exception message.