'How to get user name instead of SID during WMI logcollection

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. enter image description here



Solution 1:[1]

SELECT * FROM Win32_AccountSID should get you a list you can match the SID to the name.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anders