To clarify the title.
When you create an application pool in IIS you give it a name. You can then set the identity to ApplicationPoolIdentiy.
Windows then creates this magic user you can't see. Say the app pool name is MyTestAppPool so you would end up with a user called MyTestAppPool (IIS AppPool\MyTestAppPool)
When this happens Windows uses the servers current locale. Let's say it was US at the time.
Then later you change it to UK. While there is a copy this doesn't copy to these magic users I've found. So your server is set to UK while your MyTestAppPool is set to US.
So when a website runs and you need to say format something to currency in the correct locale you end up with US currency because of the AppPool instead of UK currency.
Is there a way to change the AppPool user's locale?
The only way I have found is to delete the app pool and recreate it again after you've set the servers locale to what you want. What if I don't want to do that.
What if I need to have multiple websites running in different locales how would I set the AppPoolIdentity user locale to each of these without having to change the server to what I want before I create the apppool?
Click the Locations button and make sure that you select your computer. Enter IIS AppPool\<myappoolname> (eg: IIS AppPool\PK Protect) in the Enter the object names to select: text box. Click the Check Names button and click OK. Check Modify under the Allow column, and click OK, and OK.
ApplicationPoolIdentity: When a new application pool is created, IIS creates a virtual account that has the name of the new application pool and that runs the application pool worker process under this account. This is also a least-privileged account.
When you create and use an App Pool Identity, a "user" is created and there is a folder at C:\Users\AppPoolName
.
In C:\Windows\System32\inetsrv\config\applicationHost.config
there is an element which on my machine looks like this:
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="false" />
</applicationPoolDefaults>
The combination of these two settings determines the environment (and thus locale) settings that app pool identity runs as.
You should be able to figure out the unique Id by checking in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist
for the user that loads the ..\Users\AppPoolName\NTUSER.DAT
and then match it up with the settings in HKEY_USERS\UnqiueId\ControlPanel\International\Locale
settings.
It may just be simpler to set setProfileEnvironment="false"
unless you need the settings.
You can set the culture of your application via web.config or on page level. This should override the application pool user's culture.
have a look at this https://msdn.microsoft.com/en-us/library/bz9tc508(v=vs.140).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With