locked
WSMAN and WMI Locale RRS feed

  • Question

  • Hello,

    I know that it is possible to request data from the WMI server in a client-preferred locale (MS-LCID). 

    Is it possible to specify 'locale' when we use WSMan to request data from WMI?

    There is an option 'wsman:Locale' in WSMan specification but looks like it doesn't affect Enumerate requests.




    Tuesday, February 2, 2016 9:13 PM

All replies

  • Hi Igor,
    Thank you for this inquiry. One of our engineers will look into this and follow-up soon.

    Regards,
    Edgar

    Tuesday, February 2, 2016 9:34 PM
  • Just to clarify

    Here is WMI query

    Select Caption from Msvm_ComputerSystem

    on German HyperV server it returns 'Virtueller Computer' instead of 'Virtual Machine'

    it is possible to specify English locale for WMI 

    Get-WmiObject -Locale MS_409 -Query "Select Caption from Msvm_ComputerSystem"  -Namespace root/virtualization/v2 

    But looks like it is not possible for WSMan, it always returns data in the default locale.


    Tuesday, February 2, 2016 10:03 PM
  • Hello Igor, I will be assisting you with your question. Can you try the following steps.

    Open a command prompt and set the code page as needed.
    See https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/chcp.mspx?mfr=true for details.

    For instance executing "chcp 437" will set the active codepage to United States region.
    Set the command propmpt "Font" type to Lucida Console.

    Execute your WMI query and confirm if the results show up as expected.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications


    Wednesday, February 3, 2016 4:08 PM
  • Hello Sreekanth,

    I don't understand how active console code page may affect data returned by WSMan.

    I have tried proposed solution and it didn't help, see attached screenshot. WMI still return Caption in German.

    I think that your solution is totally unrelated, there is a WMI option, that allows to specify client-preferred locale in MS-LCID format, it is possible to pass Locale to Get-WmiObject cmdlet, but is it possible to pass this parameter in WSMan request?


    • Edited by igor.golikov Wednesday, February 3, 2016 7:41 PM
    Wednesday, February 3, 2016 7:40 PM
  • Hello Igor, Since the command environment is set to a different locale, I had assumed that any newly executed process will inherit the new locale.

    Let me research this further.

    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Wednesday, February 3, 2016 9:41 PM
  • Sreekanth, 'chcp' sets the code page. Code page sets the character set used for encoding, it cannot change the language 
    Wednesday, February 3, 2016 10:10 PM
  • Hello Igor, can you contact me at dochelp@ microsoft dot com ? I want to share some findings and we will also post the summary of the investigation in this forum thread later.


    Regards,
    Sreekanth Nadendla
    Microsoft Windows Open Specifications

    Friday, February 5, 2016 7:39 PM