I have a web application (.Net 2.0, IIS 6 Windows 2003) that uses an
unprivileged user as the identity for the application pool. IIS
requires the user have the "log on as a batch job" right. My web
application calls a WCF MSMQ service and uses a certificate for
authentication (not encryption as this is a workgroup server).
Unfortunately, the application cannot find the certificate and throws
an exception. I believe this to be because IIS is doing a "log on as a
batch job" and the user's certificate store is not available. As soon
as I open a command shell "runas" the user, the user's profile is
loaded, the certificate store is available and I can successfully send
an authenticated request to my WCF service.

I'm happy I finally managed to establish why this was working
sporadically:
Step 1 - send request to web service; fails because can't find
certificate
Step 2 - open MMC "runas" IIS application pool identity to check
certificate exists
Step 3 - yep, it's there alright
Step 4 - oh, now my application works, WTF

Is there some way to require IIS to load the application pool identity
profile?