A: 

I guess this Windows 7 machine has some problem accessing the domain. So I suggest you,

  1. Remove this Windows 7 machine from the domain.
  2. Join this machine back to the domain.

It should have nothing related to either Windows 7 or the IIS server, as if you search using the error message "The trust relationship between this workstation and the primary domain failed" you can find most results are related to active directory.

Lex Li
As I noted in the original question, I've already tried re-joining the machine to the domain but it didn't help.
Sean Carpenter
+1  A: 

I finally found an answer to this after experiencing the same problem on Windows Server 2008 R2. From this article:

Disable the following policies on the Windows 2008 R2 server, run gpupdate /force and restart the server.

"Computer Configuration\Windows Setting\Security Settings\Local Policies\Security Option"

Domain Member: Digitally encrypt or sign secure channel data (always)
Domain Member: Digitally encrypt secure channel data (When possible)
Domain Member: Digitally sign secure channel data (When possible)

I can confirm that this fixed the problem on Windows 7 as well.

Sean Carpenter
A: 

I'm adding this for future reference:

"Error 1789 when you use the LookupAccountName function on a computer that is running Windows 7 or Windows Server 2008 R2"

http://support.microsoft.com/kb/976494

That might be a solution to the problem as well.

jishi