Get SID from Username and Username from SID using WMI Queries

microsoft black logo

Last updated on September 25th, 2021 at 08:50 pm

Read Time:1 Minute, 3 Second


This post will show you how to get the username of a SID. This will help you when you need to make amendments within a computers registry for HKEY_CURRENT_USER (HKCU).


Open a command prompt on the computer that a change is required for and run the followinng command:

wmic useraccount get name, sid, status

This will now look into the computers WMI and provide you with a list of SIDs and their user account name.

If you have many SIDs and user accounts on one machine, then you can scale the search down by using the following command instead:

wmic useraccount where name='username' get name, sid, status


  • username‘ = the username of the SID you are trying to find.

You can also reverse this query and use the SID to get the username by running this command:

wmic useraccount where sid='S-1-5-11-1111111111-111111111-1111111111-1111' get name


  • S-1-5-11-1111111111-111111111-1111111111-1111‘ = the SID of the username you are trying to find.


If you have any questions or feedback on this post, please feel free to leave us a message below and we will get back to you as soon as we can.

Avatar for Andrew Armstrong

About Post Author

Andrew Armstrong

Founder of TechyGeeksHome and Head Editor for over 15 years! IT expert in multiple areas for over 23 years. Sharing experience and knowledge whenever possible! Making IT Happen.
Click to rate this post!
[Total: 0 Average: 0]

Free Subscription

If you want to be notified when we post more quality guides like this one, sign up to our free subscription service and you will receive an email when a new post is live.

Join 555 other subscribers.

No need to worry, we will not be filling your inbox with spam and you can unsubscribe anytime you like.

Leave us a message...

This site uses Akismet to reduce spam. Learn how your comment data is processed.