During a review of the SharePoint farm health, we saw a lot of these errors in the event logs. The farm itself was still functional, but these errors were filling the event logs. The account is question was the same one that was used for the IIS website application pools.
Stop the relevant application pools
Stop the IIS Admin Service (in services.msc)
- Stop the Web Server
- Provision logon locally rights to DOMAIN\AppPoolAccount
Now open a command window (Start-Run-> type “CMD” ) and in the window type the following:
net localgroup administrators DOMAIN\AppPoolAccount /add
runas /u:DOMAIN\AppPoolAccount /profile cmd
After the second command, you will be prompted to enter the password of the DOMAIN\AppPoolAccount and when you hit enter it will launch a new window. In the window type the following to confirm the user profile directory
5. Launch the User Profiles dialog or check “C:\users” to verify that the directory for your application pool account ID has been created.
Close the second command window, and in the original one type the following to remove the app pool account from the administrators group. For whatever reason it only needed to be there to create the local profile and it’s not best practices or recommended that you leave the account as an admin on a production farm.
net localgroup administrators DOMAIN\AppPoolAccount /delete
7. Exit the command window
8. Start the Web Server
9. Enable and then Start the IIS Admin Service.