You can use Win32_UserAccount with the right SID
How to get user name instead of SID during WMI logcollection
shiv raj kr
1
Reputation point
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.
Any help much appreciated? Thank you.
Windows for business | Windows Client for IT Pros | Directory services | Active Directory
7,023 questions
Windows for business | Windows Server | User experience | Other
20,212 questions
Windows for business | Windows Client for IT Pros | User experience | Other
2 answers
Sort by: Most helpful
-
-
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,