Problem
After setting custom identity for IIS Application Pool you are experiencing error 503 Service Unavailable in browser and in System section of Event Log on server you may find the following warnings and errors:
Event ID 5021:
The identity of application pool x is invalid. The user name or password that is specified for the identity may be incorrect, or the user may not have batch logon rights. If the identity is not corrected, the application pool will be disabled when the application pool receives its first request. If batch logon rights are causing the problem, the identity in the IIS configuration store must be changed after rights have been granted before Windows Process Activation Service (WAS) can retry the logon. If the identity remains invalid after the first request for the application pool is processed, the application pool will be disabled. The data field contains the error number.
Event ID 5057:
Application pool x has been disabled. Windows Process Activation Service (WAS) did not create a worker process to serve the application pool because the application pool identity is invalid.
Event ID 5059:
Application pool x has been disabled. Windows Process Activation Service (WAS) encountered a failure when it started a worker process to serve the application pool. Continue reading