How to get user name instead of SID during WMI logcollection

shiv raj kr 1 Reputation point
2022-02-07T14:28:38.883+00:00

I'm looking for a possible solution to convert a Windows user SID to a username.

I am running WQL queries against some local namespace and would like to know if there are any possibilities to get a username instead SID like an event viewer. I am using WBEMTest for testing.

Screenshot for reference.

171962-image.png

Any help much appreciated? Thank you.

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Windows for business | Windows Server | User experience | Other
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2022-02-07T14:44:16.15+00:00

    You can use Win32_UserAccount with the right SID


  2. Clément BETACORNE 2,496 Reputation points
    2022-02-07T15:11:41.897+00:00

    Hello,

    This command will query the table where you can find SIDs :

    Select * From win32_accountSID  
    

    https://learn.microsoft.com/en-us/previous-versions/windows/desktop/secrcw32prov/win32-accountsid

    Regards,


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.