Getting the Username from the HKEY_USERS values

前端 未结 9 1217
予麋鹿
予麋鹿 2021-01-30 04:08

Is there a way to connect between the values under HKEY_USERS to the actual username?
I saw some similar questions, but most (if not all) talks about C# code, and my need is

9条回答
  •  忘掉有多难
    2021-01-30 04:50

    It is possible to query this information from WMI. The following command will output a table with a row for every user along with the SID for each user.

    wmic useraccount get name,sid
    

    You can also export this information to CSV:

    wmic useraccount get name,sid /format:csv > output.csv
    

    I have used this on Vista and 7. For more information see WMIC - Take Command-line Control over WMI.

提交回复
热议问题