none
Strange answer to WMI query for user name in Microsoft account on windows 8.1 RRS feed

  • คำถาม

  • Hi,
    We have executed the below query when logged in with a Microsoft account on Windows 8.1 PC.
    (get-wmiobject Win32_ComputerSystem –ComputerName "<user pc="" name="">").UserName

    We have received the below Answer.

    Lenovo-Pc/user.@outlook.com>

    But, our user in the market got the below response.

    Lenovo-Pc/LENOVO-PC/user.@outlook.com>

    This strange answer is received on Microsoft account in Windows 8.1.
    Due to this our code failed.

    Which PC setting causes the powershell to give the strange answer for UserName query?

    Appreciate any quick response.

    Thank you very much.

    3 พฤษภาคม 2562 3:45

ตอบทั้งหมด

  • Hi,

    Thanks for your question.

    It's hard to tell you what will cause this problem. But it is not a powershell issue. You can try to run the powershell command on the destination remote computer without -computername parameter. To check if the result is normal.

    Best regards,

    Lee


    Just do it.

    6 พฤษภาคม 2562 12:26
    ผู้ดูแล
  • Here is a little background on that WMI property.

    The property is a derived value.  When WMI is queried the provider calls the system to retrieve the account currently logged in at the console.

    When the console account is an online associated account then that may be the value returned although this appears to be affected by the sync state of the account at the time of the query.  It may also be affected by the source of the query.  A remote query and a local query may return different values for the account name.

    If there are issues with this then then you will need to contact Microsoft support for assistance.  This has nothing to do with PowerShell or with WMI but is a result of how the OS is responding to the call for the current logged in account. If you believe it to be a bug then post in the "uservoice" site for any response.


    \_(ツ)_/

    6 พฤษภาคม 2562 12:32
    ผู้ดูแล
  • Thank you for your reply.

    When the console account is an online associated account then that may be the value returned although this appears to be affected by the sync state of the account at the time of the query. 

    The console account is online associated in our test scenario.

    we will verify if sync state is causing the issue.

    It may also be affected by the source of the query.  A remote query and a local query may return different values for the account name.

    Yes. We agree.

    If there are issues with this then then you will need to contact Microsoft support for assistance.  This has nothing to do with PowerShell or with WMI but is a result of how the OS is responding to the call for the current logged in account.

    The behavior is different on Windows 8.1 ENU and JPN versions.

    On ENU version, the strange behaviors is seen consistently.

    On JPN version, it occurs rarely.

    If you believe it to be a bug then post in the "uservoice" site for any response.

    We will check the sync settings and then if required, we will raise the issue.


    6 พฤษภาคม 2562 12:42
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee



    Just do it.

    24 พฤษภาคม 2562 5:59
    ผู้ดูแล
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,

    Lee


    Just do it.

    31 พฤษภาคม 2562 3:13
    ผู้ดูแล