How to find the SID (Security Identifier) ​​for a user account in Windows

If you've ever managed File and Folder permissions or browsed the Registry, you may have seen a long string of values ​​like 'S-1-5-21-3011698416-3634052959-2884390752-500'.

This string is called the Security Identifier or the SID. Each user will have a unique SID value. This article will show you how to find the SID for Windows user accounts.

What is SID?

The Security Identifier is a unique string of values ​​issued by an authority such as the Windows Domain Controller to all security and privacy groups. This security identifier is automatically generated when a security group is created. Once the SID is generated, it is stored in the database and retrieved as needed.

When the SID and user rights are combined, Windows will provide the user with an access token every time you log into the system. This access token in turn provides the appropriate permission and security context for Windows system management. Simply put, the SID is one of the important parts of the Windows Security Model.

Other than the auto-generated SID, Windows also has a few well-known common SIDs such as Everyone, Local Authority, World, NT Authority, and All Services. There are many ways to find the SID of a specific user or all Windows users. Here are several ways to find the user ID, use the one that works best for you.

How to find the SID of any user on Windows

1. Using Command Prompt

The simplest way to check the SID of the currently logged in user on your PC is to use the whoami command. It will show the SID with the help of the 'user' argument with the command. The only limitation is that it cannot display multiple SIDs of a single user.

 

Here's how to do it:

1. Press Win + R to launch the Run dialog box. Type cmd in the text box and press Ctrl + Shift + Enter to open Command Prompt.

2. The User Account Control window will appear. Click the Yes button to open the application with admin rights if prompted.

3. Now, type the following command to view the SID of the currently logged in user account:

whoami /user

How to find the SID (Security Identifier) ​​for a user account in Windows Picture 1How to find the SID (Security Identifier) ​​for a user account in Windows Picture 1

4. You will see the currently logged in username and the corresponding SID. You can directly select and copy text from the Command Prompt window. But if you want to export the details to a text file for later use, you can do so by entering the following command:

whoami /user > C:SID.txt

5. The above command will create a text file named SID in drive C. You can open it with Notepad or any other text editor application.

6. Close the Command Prompt window.

2. Using WMIC

You can easily view the SIDs of all users or a single user on your PC with the WMIC command line tool. You do not need to open a Command Prompt window with admin rights to use WMIC and view the SID.

 

Follow these steps to do this:

1. Right-click the Start button to open the Power User menu. Click the Terminal option.

2. Type the following command and press Enter key to execute it:

wmic useraccount get name,sid

3. The above command will display the username and corresponding SID of all user accounts. The example case shows 3 local accounts (a, b and t) and the admin, guest, default account and the WDAGUtility account.

4. You can export all this data to a text file on drive D by executing the following command:

wmic useraccount get name,sid > D:SID.txt

How to find the SID (Security Identifier) ​​for a user account in Windows Picture 2How to find the SID (Security Identifier) ​​for a user account in Windows Picture 2

5. If you want to get details about a specific user account on your PC, the command syntax is:

wmic useraccount where name="USER" get sid

6. Replace the USER part of the command with the actual user name. In the example case, the command would be:

wmic useraccount where name="a" get sid

How to find the SID (Security Identifier) ​​for a user account in Windows Picture 3How to find the SID (Security Identifier) ​​for a user account in Windows Picture 3

 

7. Close the Command Prompt window.

3. Using PowerShell cmdlet

PowerShell provides the Get-WmiObject cmdlet so you can see the SIDs of all user accounts on a Windows PC. Like the WMIC method, you can view the SIDs of all users with a single command.

Follow these steps:

1. Press Win + R to launch the Run dialog box. Type powershell in the text box and press the Ctrl + Shift + Enter keys to open PowerShell.

2. The User Account Control window will appear. Click the Yes button to open the application with admin rights if prompted.

3. Type the following command and press Enter key :

Get-WmiObject win32_useraccount | Select name,sid

How to find the SID (Security Identifier) ​​for a user account in Windows Picture 4How to find the SID (Security Identifier) ​​for a user account in Windows Picture 4

4. The above command will display all user accounts and their respective SIDs. To output the results as a text file, execute the following command:

Get-WmiObject win32_useraccount | Select name,sid > C:SID.txt

5. The command will save the file to the C drive. Access the location with File Explorer and open the file in a text editor application.

6. Close the PowerShell window.

4. Use Registry Editor

If Command Prompt or PowerShell is not working on your PC, you can use Registry Editor to see all the SIDs on your PC. This method is not as convenient as viewing the complete list of SIDs in the terminal or in a text file. You'll have to do some manual work to find their SID and username.

Here's how to do it:

1. Press Win + R to launch the Run dialog box. Type regedit in the text box and press Ctrl + Shift + Enter keys simultaneously .

2. The User Account Control window will appear. Click the Yes button.

3. Go to the address bar at the top, paste the following path and press Enter key :

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionProfileList

4. Click on any SID subkey to select it and move on to the right section.

5. Now find the ProfileImagePath value and double click on it to open the Edit window. You will see the username of the SID in the Value Data field .

How to find the SID (Security Identifier) ​​for a user account in Windows Picture 5How to find the SID (Security Identifier) ​​for a user account in Windows Picture 5

 

6. Similarly, you can check other SID keys and open their ProfileImagePath value to find the corresponding username.

7. Then close the Registry Editor application.

5. Use batch files

If you find the Terminal route cumbersome, you can create a batch file to display the SIDs of all users at once. Follow these steps to create a batch file:

1. Press Win + D to switch to the desktop.

2. Right-click an empty space on the desktop and click the New > Text Document option .

3. A new text file will appear on the desktop. Double-click the file to open it in a Notepad window.

4. Now, paste the following code into the Notepad file:

@echo off cmd.exe /k wmic useraccount get name,sid pause

5. Press Ctrl + Shift + S to open the Save as window . Keep the file name as SID.bat and the Save as Type field as All Files .

How to find the SID (Security Identifier) ​​for a user account in Windows Picture 6How to find the SID (Security Identifier) ​​for a user account in Windows Picture 6

6. Navigate to the folder location where you saved the batch file. Double click on it to run the file.

7. A Terminal window will launch and display all the users on your PC and their respective SIDs.

How to find the SID (Security Identifier) ​​for a user account in Windows Picture 7How to find the SID (Security Identifier) ​​for a user account in Windows Picture 7

Wishing you success!

5 ★ | 1 Vote