Getting regional settings /language setting from wmi

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Arie H Arie H 1 year, 3 months ago.

  • Author
  • #37893
    Profile photo of Wei-Yen Tan
    Wei-Yen Tan

    I am just wondering what the class name is to find the regional settings of a Windows OS? I am using it for a report. I am preferring wmi because at the moment we have servers that are still using powershell v2 and they don't want to upgrade to the latest version just yet.

    Any help appreciated.

  • #37898
    Profile photo of Arie H
    Arie H

    I dont think you'll find it via wmi.
    Regional data is stored in the registry per profile, not per computer.
    You can look at the registry to get the data you want, it will be under hkey_current_user or hkey_users\ and then Control Panel\International

  • #37899
    Profile photo of Matt Bloomfield
    Matt Bloomfield

    Win32_Operating system is probably your best bet, using the CountryCode, Locale and OSLanguage properties.

    You'll probably want to translate the codes used into words (e.g. English_United_Kingdom is stored as 0809) but the lists are easy to find online and you can build a lookup table for your script.

  • #37902
    Profile photo of Arie H
    Arie H

    Although country code might hint the regional, the locale and OSLangugae definitely dont relate to regional settings. I could have a Arabic locale windows and Arabic interface, but my regional would be Yemen, or Saudi Arabia, or others.

You must be logged in to reply to this topic.