Changing IIS Regional Settings (for ASP Date, Time, Currency, etc)
posted under
IIS
by Unknown
How to safely change the regional settings for IIS.
I recently installed a new server and ran in to a problem I've incurred before - despite me hanging the servers regional settings to use U.K. formatting for dates and numbers, all my ASP pages were defaulting to U.S. regional settings. This is because Microsoft, in all their wisdom, decided that IIS (Internet Information Services) should take its regional settings from the IUSR account (an account whose password is generated by the server and not known to the server administrator - go figure).
Now many ASP purists will say that you should always set the locale of your application (e.g. website) anyway, forcing the server to acknowledge your region of choice - I agree. The problem is however, that I host websites I haven't created myself and also that many third party solutions and dreamweaver extensions) physically format the date how they want it - making regional settings ineffective.
Although I've seen all sorts of solutions out there, from registry changes to resetting the IUSR password, I hadn't found one I was entirely comfortable with. Firstly, registry setting changes always make me twitchy and secondly, resetting the password to the IUSR account can cause windows to permanently deny access to some IUSR recources.
The Solution
I took the obvious route instead and decided to find out how to get hold of the IUSR password that generated automatically and simply use the RUN AS option when firing up the regional settings dialogue to run them as the IUSR - so, down to business:
In order to allow the password to appear as anything other than asterisks you need to update the adsutil.vbs script (found in the AdminScripts folder in the Inetpub folder (often
C:/InetPub/AdminAcripts). Open the adsutil.vbs file in Notepad and search for "IsSecureProperty =
True", replace it with "IsSecureProperty = False" and save the file (keep it open so you can easily change it back afterwards).
Open a command prompt window (START > RUN > Type 'cmD' > OK)Browse to the InetPub/AdminScripts folder, for example:
C: (press enter)
CD \ inetpub\AdminScripts
To Retrieve the IUSR Password, enter this command:
cscript adsutil.vbs get w3svc/anonymoususerpass
Should return something like: anonymoususerpass : (STRING) "/fre5hJe7x"!39I"
To Retrieve the IWAM Password, enter this command:
cscript adsutil.vbs get w3svc/wamuserpass
Should return something like: wamuserpass : (STRING) "1like808!"
Now in the Control Panel, hold down the shift key and right click on the "Regional Settings" icon
Select "Run As" from the menu that appears
Login as the IUSR_yourServerName using the password retrieved above
Change the regional settings to whatever you need them to be for IIS and your done.
You may need to restart the server for the changes to take effect.
Don't forget to change the adsutil.vbs line back to read "IsSecureProperty = False"!
I recently installed a new server and ran in to a problem I've incurred before - despite me hanging the servers regional settings to use U.K. formatting for dates and numbers, all my ASP pages were defaulting to U.S. regional settings. This is because Microsoft, in all their wisdom, decided that IIS (Internet Information Services) should take its regional settings from the IUSR account (an account whose password is generated by the server and not known to the server administrator - go figure).
Now many ASP purists will say that you should always set the locale of your application (e.g. website) anyway, forcing the server to acknowledge your region of choice - I agree. The problem is however, that I host websites I haven't created myself and also that many third party solutions and dreamweaver extensions) physically format the date how they want it - making regional settings ineffective.
Although I've seen all sorts of solutions out there, from registry changes to resetting the IUSR password, I hadn't found one I was entirely comfortable with. Firstly, registry setting changes always make me twitchy and secondly, resetting the password to the IUSR account can cause windows to permanently deny access to some IUSR recources.
The Solution
I took the obvious route instead and decided to find out how to get hold of the IUSR password that generated automatically and simply use the RUN AS option when firing up the regional settings dialogue to run them as the IUSR - so, down to business:
In order to allow the password to appear as anything other than asterisks you need to update the adsutil.vbs script (found in the AdminScripts folder in the Inetpub folder (often
C:/InetPub/AdminAcripts). Open the adsutil.vbs file in Notepad and search for "IsSecureProperty =
True", replace it with "IsSecureProperty = False" and save the file (keep it open so you can easily change it back afterwards).
Open a command prompt window (START > RUN > Type 'cmD' > OK)Browse to the InetPub/AdminScripts folder, for example:
C: (press enter)
CD \ inetpub\AdminScripts
To Retrieve the IUSR Password, enter this command:
cscript adsutil.vbs get w3svc/anonymoususerpass
Should return something like: anonymoususerpass : (STRING) "/fre5hJe7x"!39I"
To Retrieve the IWAM Password, enter this command:
cscript adsutil.vbs get w3svc/wamuserpass
Should return something like: wamuserpass : (STRING) "1like808!"
Now in the Control Panel, hold down the shift key and right click on the "Regional Settings" icon
Select "Run As" from the menu that appears
Login as the IUSR_yourServerName using the password retrieved above
Change the regional settings to whatever you need them to be for IIS and your done.
You may need to restart the server for the changes to take effect.
Don't forget to change the adsutil.vbs line back to read "IsSecureProperty = False"!
Comment Form under post in blogger/blogspot