So we have a newly installed SP2013 sp1 farm running on WinSRV 2012 r2.
2 WFE / 2 APP / 2 SQL 2012(HA)
Issue is that every night at 3:30-ish.. Â we have a Critical Error on all Sharepoint boxes.
Event ID 3351 : SQL database login for ´sharepoint_config´ on instance ´sharepointsql13´failed.  login failed for user ´domain/servername$´
The google tells me to look all over the place but nothing yet has helped me, Â the timer service runs as “farm account” and looks allright.
i am quite new at sharepoint so i would like some expert help from you all to add to my knowledge 🙂
The Issue was still there this morning! and i found out the following!.
the timer job runs a check using a PowerShell call. For some reason, the PowerShell call does not run as the timer job account but the local system account (hence the DOMAINSERVER$).
Those local accounts do not have permissions to run PowerShell commands against the SharePoint farm. Therefore one must allow access to these local accounts by adding them as “Shell Admins”:
So i ran thisÂ
Get-SPDatabase | Add-SPShellAdmin -UserName DOMAIN\SERVER1$Â
Get-SPDatabase | Add-SPShellAdmin -UserName DOMAIN\SERVER2$Â
Get-SPDatabase | Add-SPShellAdmin -UserName DOMAIN\SERVER3$Â
Get-SPDatabase | Add-SPShellAdmin -UserName DOMAIN\SERVER4$
Hopefully error will not be there tomorrow!.