After installing recent windows updates on a server, a script that accessed SQL server from the SYSTEM account suddenly gets rejected with "Msg 18456 ... ANONYMOUS LOGON". This is a much simpler scenario than what I have seen in other threads.
There is no domain, this is a standalone server outside the firewall.
This is not really a network access, everything happens on one server.
Both server OS and SQL Server are version 2008 R2.
This access is from a scheduled task (Windows Scheduler, AT command) running as Local System .
A similar machine which hasn't received the same Windows updates doesn't fail.
Here is a simplified proof-of-concept batch file demonstrating the problem:
------- Typed this in because IE refuses to let me paste in this forum -------
SET COMPUTER >%TMP%\testout.txt 2>&1
SET USER >>%TMP%\testout.txt 2>&1
whoami >>%TMP%\testout.txt 2>&1
sqlcmd -Q "USE master;" >>%TMP%\testout.txt 2>&1
------- End of file -------
Ran this with the command
AT hh:mm "C:\Windows\Temp\test.bat"
and then waited until hh:mm to grab testout.txt.
Output on computer where this fails (I replaced computer name with BAD and workgroup name with CONTOSO):
------- Typed this in because IE refuses to let me paste in this forum -------
COMPUTERNAME=BAD
USERDOMAIN=CONTOSO
USERNAME=BAD$
USERPROFILE=C:\Windows\system32\config\systemprofile
nt authority\system
Msg 18456, Level 14, State 1, Server BAD, Line 1
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
------- End of file -------
Output on very similar computer with fewer windows updates applied (I replaced computer name with GOOD and workgroup name with CONTOSO):
------- Typed this in because IE refuses to let me paste in this forum -------
COMPUTERNAME=GOOD
USERDOMAIN=CONTOSO
USERNAME=GOOD$
USERPROFILE=C:\Windows\system32\config\systemprofile
nt authority\system
Changed database context to 'master'.
------- End of file -------