SharePoint – WAS – Event ID 5021

I just had a customer who’s SharePoint application pool keep stopping.

We had the following output in the event log on the server:

There can be 2 resolutions to this error, the following needs to be done.

  • Incorrect application pool credentials, one needs to update the credentials:
    1. Open “IIS”.
    2. Navigate to “Application Pools”.
    3. Find the stopped application pool, right click it and choose “Advanced Settings”.
    4. Under “Process Model”, find “Identity” then click on the “…” next to it.
    5. Apply the updated credentials information, like [Domain]\[Username] and your new password.
  • The service account is not member of “Logon as a batch” policy:
    1. Open “gpedit.msc” in cmd on the local machine, or open the Domain GPO on your administrative machine.
    2. Navigate to “Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment -> Logon as a batch job”.
    3. Add your service account here.

If you had a default domain policy, now run the following in a cmd.exe prompt:

This should update the local policy on the machine.

Experienced advanced operations engineer with a demonstrated history of working in the information technology and services industry. Skilled in Windows Server, Azure, Ethical Hacking, Office 365, Exchange, Jenkins, SCCM, Octopus Deploy and PowerShell to name a few. Strong engineering professional with a big passion for knowledge.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.