Google+ Pieces o' Eight: Match a user's username to their SID

Monday, 22 April 2013

Match a user's username to their SID

If you've ever poked around in the Windows Registry on a multi-user machine you may have noticed that user settings are stored against an SID such as  S-1-5-21-2827067247-3228746870-1612205067-500.

Often it's useful to be able to match an SID up to a user name and here's how:

1) Open a command prompt.
2) Type: wmic useraccount get name,sid
3) Press enter

You'll then see a list such as the following, giving you the user name and the associated SID:


Name            SID
Administrator   S-1-5-21-2827067247-3228746870-1612205067-500
Guest           S-1-5-21-2827067247-3228746870-1612205067-501
HomeGroupUser$  S-1-5-21-2827067247-3228746870-1612205067-1002
Martin          S-1-5-21-2827067247-3228746870-1612205067-1000

Simples!

No comments:

Post a Comment