Accounts Find Security Identifier (SID) of User in Windows 11


  • Staff
Accounts_banner.png

This tutorial will show you how to find the security identifier (SID) of a specific user or all users on your Windows 10 and Windows 11 PC.

A security identifier (SID) is a string value of variable length that is used to uniquely identify a security principal or security group. Security principals can represent any entity that can be authenticated by the operating system, such as a user account, a computer account, or a thread or process that runs in the security context of a user or computer account.

Each account or group, or each process that runs in the security context of the account, has a unique SID that's issued by an authority, such as a Windows domain controller. The SID is stored in a security database. The system generates the SID that identifies a particular account or group at the time the account or group is created. When a SID has been used as the unique identifier for a user or group, it can never be used again to identify another user or group.

Each time a user signs in, the system creates an access token for that user. The access token contains the user's SID, user rights, and the SIDs for any groups the user belongs to. This token provides the security context for whatever actions the user performs on that computer.

Users refer to accounts by the account name, but the operating system internally refers to accounts and processes that run in the security context of the account by using their SIDs.

The operating system generates a SID that identifies a particular account or group at the time the account or group is created. The SID for a local account or group is generated by the Local Security Authority (LSA) on the computer, and it's stored with other account information in a secure area of the registry.

For every account and group, the SID is unique for the computer where it was created. No two accounts or groups on the computer ever share the same SID.

Reference:


Contents

  • Option One: Find SID of Current User using "WhoAmI" command
  • Option Two: Find SID of Current User using "wmic useraccount" command
  • Option Three: Find SID of Current User using "GetCurrent" PowerShell command
  • Option Four: Find SID of Specific User using "wmic useraccount" command
  • Option Five: Find User Name for SID using "wmic useraccount" command
  • Option Six: Find SID of All Users using "wmic useraccount" command
  • Option Seven: Find SID of All Users using "Get-WmiObject" PowerShell command
  • Option Eight: Find SID of All Users using "Get-LocalUser" PowerShell command
  • Option Nine: Find SID of Users in Registry Editor


EXAMPLE: Security Identifier (SID) with account association

SID.png






Option One

Find SID of Current User using "WhoAmI" command


1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.

2 Copy and paste the command below into Windows Terminal, and press Enter. (see screenshot below)

whoami /user

SID_whoami_user.png





Option Two

Find SID of Current User using "wmic useraccount" command


1 Open Windows Terminal, and select Command Prompt.

2 Copy and paste the command below into Windows Terminal, and press Enter. (see screenshot below)

wmic useraccount where name='%username%' get domain,name,sid


SID_wmic_current_useraccount.png





Option Three

Find SID of Current User using "GetCurrent" PowerShell command


1 Open Windows Terminal, and select Windows PowerShell.

2 Copy and paste the command below you want to use into Windows Terminal, and press Enter. (see screenshots below)

(Outputs SID with username)​
[Security.Principal.WindowsIdentity]::GetCurrent() | Select-Object -Property @('Name', 'User')

OR​

(Outputs only SID)​
[System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value

GetCurrent_SID.png

GetCurrent_SID-2.png





Option Four

Find SID of Specific User using "wmic useraccount" command


1 Open Windows Terminal, and select Command Prompt.

2 Type the command below into Windows Terminal, and press Enter. (see screenshot below)

wmic useraccount where name='username' get sid


Substitute username in the command above with the actual user name (ex: "Brink") of the account you want to know the SID for.

For example: wmic useraccount where name='Brink' get sid


SID_wmic_specific_useraccount.png





Option Five

Find User Name for SID using "wmic useraccount" command


1 Open Windows Terminal, and select Command Prompt.

2 Type the command below into Windows Terminal, and press Enter. (see screenshot below)

wmic useraccount where sid='<sid>' get domain,name


Substitute <sid> in the command above with the actual SID (ex: "S-1-5-21-1858701626-1738369404-427713822-1001") of the account you want to know the user name for.

For example: wmic useraccount where sid='S-1-5-21-1858701626-1738369404-427713822-1001' get domain,name


SID_wmic_useraccount_name.png





Option Six

Find SID of All Users using "wmic useraccount" command


1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.

2 Copy and paste the command below into Windows Terminal, and press Enter. (see screenshot below)

wmic useraccount get domain,name,sid


SID_wmic_all_useraccounts.png





Option Seven

Find SID of All Users using "Get-WmiObject" PowerShell command


1 Open Windows Terminal, and select Windows PowerShell.

2 Copy and paste the command below into Windows Terminal, and press Enter. (see screenshot below)

Get-WmiObject win32_useraccount | Select domain,name,sid

SID_Get-WmiObject.png





Option Eight

Find SID of All Users using "Get-LocalUser" PowerShell command


1 Open Windows Terminal, and select Windows PowerShell.

2 Copy and paste the command below into Windows Terminal, and press Enter. (see screenshot below)

Get-LocalUser | Select-Object -Property @('Name', 'SID')

Get-LocalUser_SID.png





Option Nine

Find SID of Users in Registry Editor


1 Open Registry Editor (regedit.exe).

2 Navigate to the key below in the left pane of Registry Editor. (see screenshot below)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

3 Each subkey under the ProfileList key in the left pane represents a SID. Look at the ProfileImagePath value in the right pane for each SID subkey to identify the full path of an account's profile folder name.

For example, the S-1-5-21-1858701626-1738369404-427713822-1001 subkey is the SID for the user with the C:\Users\Brink profile folder path and Brink being the account name.


SID_regedit.png



That's it,
Shawn Brink


 

Attachments

  • Accounts.png
    Accounts.png
    5.9 KB · Views: 15
Last edited:
This one is lengthy, but you can also do this in PowerShell:

Powershell:
[Security.Principal.WindowsIdentity]::GetCurrent() | Select-Object -Property @('Name', 'User')

If you are using a local (non-domain) account, you can do:

Powershell:
Get-LocalUser | Select-Object -Property @('Name', 'SID')

Also note that as of Windows 10 21H1, WMIC is deprecated. Not sure how much longer it will be around.

Deprecated features in the Windows client - What's new in Windows
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 [rev. 3447]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical Keyboard with Cherry MX Clears
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical Keyboard - Cherry MX Clear
Thank you @pseymour. Those have now been added to the tutorial. :shawn:
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    8TB WD MyCloudEX2Ultra NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Logitech wireless K800
    Mouse
    Logitech MX Master 3
    Internet Speed
    1 Gbps Download and 35 Mbps Upload
    Browser
    Google Chrome
    Antivirus
    Microsoft Defender and Malwarebytes Premium
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    APC SMART-UPS RT 1000 XL - SURT1000XLI,
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    HP Spectre x360 2in1 14-eu0098nr (2024)
    CPU
    Intel Core Ultra 7 155H 4.8 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Graphics card(s)
    Integrated Intel Arc
    Sound Card
    Poly Studio
    Monitor(s) Displays
    14" 2.8K OLED multitouch
    Screen Resolution
    2880 x 1800
    Hard Drives
    2 TB PCIe NVMe M.2 SSD
    Internet Speed
    Intel Wi-Fi 7 BE200 (2x2) and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Windows Defender and Malwarebytes Premium

Latest Support Threads

Back
Top Bottom