Security – Unable to set NTFS permissions for ApplicationPoolIdentity on Windows 2008 SP2

authenticationiis-7Securitywindows-server-2008

On Windows 2008 R2 I am able to set NTFS permissions for an application pool's synthesised ApplicationPoolIdentity account thus:

ICACLS d:\websites\site1\www /grant "IIS AppPool\site1":(CI)(OI)(M)

The website's application pool is named site1 and is configured to run as ApplicationPoolIdentity. The site's authentication is also configured to authenticate as ApplicationPoolIdentity. I've done this a thousand times on Windows 2008 Standard Edition R2 with never a hitch.

However if I try to do the same in Windows 2008 Standard Edition SP2 I get the error:

IIS AppPool\site1: No mapping between account names and security IDs was done.
Successfully processed 0 files; Failed processing 1 files

I also notice that this fails if I try to set permissions for the application pool identity via the security GUI as well. I've seen this before and a reboot has cleared this issue but I'd like to know why this happens periodically. Googling around suggests other folks have hit this problem but there's never a satisfactory explanation.

Why would this be?

Best Answer

Hey Kevin. The windows service used for the virtual mapping is "Application Host Helper Service" (AppHostSvc). Double check that it's running correctly, and since the problem resolves itself after a reboot, next time restart just that service and see if it temporarily resolves the issue.

It sounds like you know, but in pre-R2 you can add the user from the command line only, but then you can 'manage' it from the security GUI (as long as everything is working as it should). In R2 you can also add it in the GUI by typing in the full name (i.e. IIS AppPool\site1).