How to convert SID to user/group name and user to SID

To convert a SID to a user or group name in Windows, run ([System.Security.Principal.SecurityIdentifier]"S-1-5-32-544").Translate([System.Security.Principal.NTAccount]).Value in PowerShell, and reverse it with the NTAccount class to turn a username into a SID.

This guide covers local accounts, Active Directory users and groups, the machine and domain SID, well-known SIDs, PsGetSid, and the errors that stop a lookup.

How to convert SID to user/group name and user to SID
Get-LocalUser with the -SID parameter turns a local SID ending in -500 back into the built-in Administrator account name. (Image: Microsoft)

Convert username to SID and SID to username in PowerShell

Both directions use .NET classes that ship with Windows PowerShell 5.1 and PowerShell 7. No module or admin rights are needed for local and domain accounts the computer can resolve.

  1. Press Win + X and select Terminal or Windows PowerShell.
  2. To get the SID of a user, run ([System.Security.Principal.NTAccount]"CONTOSO\jsmith").Translate([System.Security.Principal.SecurityIdentifier]).Value, replacing CONTOSO\jsmith with the domain or computer name and the account name.
  3. Read the result: a string that starts with S-1-5-21- is the account SID.
  4. To get the name behind a SID, run ([System.Security.Principal.SecurityIdentifier]"S-1-5-21-...-1001").Translate([System.Security.Principal.NTAccount]).Value with the full SID pasted in.
  5. Read the result in DOMAIN\name form, for example BUILTIN\Administrators for S-1-5-32-544.

If Windows cannot map the value, PowerShell throws IdentityNotMappedException. The troubleshooting section below explains what that means.

What is a security identifier (SID) in Windows?

A SID is the unique value Windows uses to identify a user, group, computer or service account. Windows refers to accounts internally by SID, and permissions in access control lists store SIDs rather than names.

Windows generates the SID when the account is created and never reuses it. Delete an account and recreate it with the same name, and it gets a new SID with none of the old permissions.

Part of S-1-5-21-1004336348-1177238915-682003330-512 Value Meaning
S S Marks the string as a SID
Revision 1 Version of the SID structure
Identifier authority 5 NT Authority issued it (1 is World Authority, used by Everyone)
Domain identifier 21-1004336348-1177238915-682003330 Identifies the domain, or the computer for a local account
Relative identifier (RID) 512 Identifies the account or group inside that domain (512 is Domain Admins)

Local account SIDs are created by the Local Security Authority on the PC and stored in the registry. Domain SIDs are created by the domain and stored in the objectSID attribute of the Active Directory object.

Security identifier SID structure with domain identifier and relative identifier parts
The last subauthority is the RID that names the account, while the values before it identify the domain or computer. (Image: Microsoft)

How to find a local user security identifier (SID)

Use whoami for the account you are signed in with and Get-LocalUser for any other local account. If you also need to manage local users and groups from the command line, the same PowerShell module handles it.

  1. Open Command Prompt or PowerShell from the Start menu.
  2. Run whoami /user to show your own DOMAIN\user name and SID in a table.
  3. Run whoami /user /fo list if the SID is cut off or you want to copy it more easily.
  4. In PowerShell, run Get-LocalUser | Select-Object Name, SID to list every local account with its SID.
  5. Run Get-LocalUser -Name "jsmith" | Select-Object Name, SID to show one account.
  6. Run Get-LocalGroup | Select-Object Name, SID to list local groups such as Administrators and Users with their SIDs.
  7. For the WMI route, run Get-CimInstance -ClassName Win32_UserAccount -Filter "LocalAccount=True" | Select-Object Name, SID.

Run the local accounts cmdlets in 64-bit PowerShell. Microsoft notes that the Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit system.

Find local user SID by opening Windows PowerShell from Windows 11 Start search
Type powershell in the taskbar search box, then choose Open to run whoami /user or Get-LocalUser. (Image: Microsoft)

whoami /all command to see user and group SIDs

whoami /all prints everything in your current access token: your user SID, the SID of every group you belong to, and your privileges.

whoami /all /fo list

/all shows the user name, user SID, group names with their SIDs and the privileges in the current token. /fo list prints each entry on its own lines; /fo csv gives comma-separated output for a spreadsheet.

You should see: A USER INFORMATION block with your SID, followed by a GROUP INFORMATION block listing entries such as BUILTIN\Users with S-1-5-32-545.

The token reflects the moment you signed in. A group you were added to afterwards only appears after you sign out and back in.

How to get a user or group SID in Active Directory

The Get-ADUser and Get-ADGroup cmdlets return a SID property for every object. They live in the Active Directory module, which is installed on domain controllers and comes with RSAT on Windows 11 and Windows 10 Pro, Enterprise and Education.

  1. On a workstation, open Settings > System > Optional features and select View features or Add a feature.
  2. Search for RSAT: Active Directory Domain Services and Lightweight Directory Services Tools, select it and install it.
  3. Open PowerShell and run Get-ADUser -Identity jsmith | Select-Object Name, SamAccountName, SID to get a domain user's SID.
  4. Run Get-ADGroup -Identity "Domain Admins" | Select-Object Name, SID to get a domain group's SID.
  5. Run Get-ADUser -Filter 'Name -like "*SvcAccount"' | Select-Object Name, SID to list SIDs for several users that match a name pattern.
  6. Add -Server dc01.contoso.com to any of these commands to query a specific domain controller.

RSAT cannot be installed on Home editions of Windows. On a Home PC, use the NTAccount translation from the first section, which works for any domain the PC can resolve.

Get group SID in Active Directory with Get-ADGroup output showing SID property
Get-ADGroup returns the SID in its default output, here S-1-5-32-544 for the built-in Administrators group. (Image: Microsoft)

Getting the local machine and domain SID of a computer

A computer has two different SIDs. The local machine SID is the domain identifier shared by every local account on that PC. The domain computer account SID belongs to the computer object in Active Directory and is a separate value.

  1. To get the local machine SID, run psgetsid with no arguments, or psgetsid \\PC01 for a remote computer, using PsGetSid from Microsoft Sysinternals.
  2. Without PsGetSid, run Get-LocalUser | Where-Object SID -like "*-500" | Select-Object Name, SID to show the built-in Administrator account SID.
  3. Remove the final -500 from that SID: what remains is the local machine SID.
  4. To get the domain SID, run (Get-ADDomain).DomainSID.Value on a PC with the Active Directory module.
  5. To get a computer's domain account SID, run Get-ADComputer -Identity PC01 | Select-Object Name, SID.

Every domain account SID starts with the domain SID, followed by the account RID. That makes the domain SID a quick way to tell whether an unknown SID belongs to your domain.

Domain SID of a computer shown in Get-ADDomain output as DomainSID
Every domain account SID starts with this DomainSID value, followed by the account RID. (Image: Microsoft)

How to convert a SID to a user or group name

Pick the command that matches where the account lives. The .NET translation is the most general, because it asks Windows to resolve the SID against the local PC and every trusted domain.

  1. Copy the full SID, for example from an event log entry, a folder's security tab or a registry key name.
  2. For any account, run ([System.Security.Principal.SecurityIdentifier]"S-1-5-21-...-1001").Translate([System.Security.Principal.NTAccount]).Value in PowerShell.
  3. For a local user, run Get-LocalUser -SID S-1-5-21-...-1001 to return the account name, status and description.
  4. For a local group, run Get-LocalGroup -SID S-1-5-32-544.
  5. For a domain user, run Get-ADUser -Identity S-1-5-21-...-1105, because -Identity accepts a SID as well as a name.
  6. For a domain group, run Get-ADGroup -Identity S-1-5-21-...-512.
  7. With PsGetSid, run psgetsid S-1-5-21-...-1001 to print the matching account name.

To convert many SIDs at once, put them in a text file and run Get-Content sids.txt | ForEach-Object { ([System.Security.Principal.SecurityIdentifier]$_).Translate([System.Security.Principal.NTAccount]).Value }.

PsGetSid command to convert SID to username and back

PsGetSid is a free Microsoft Sysinternals command-line tool in the PsTools kit. It translates SIDs to names and names to SIDs for built-in, local and domain accounts, on the local PC or remote computers.

psgetsid \\PC01 -u CONTOSO\admin administrator

\\PC01 runs the lookup on a remote computer (omit it for the local PC, or use \\* for every computer in the domain). -u supplies an account with admin rights on the target; PsGetSid prompts for the password if -p is left out. The last argument is the account name to resolve, or a SID to turn into a name.

You should see: PsGetSid prints the SID for the named account, or the DOMAIN\name for a SID you passed in.

Copy PsGetSid into a folder on your executable path so psgetsid works from any prompt. It runs on Windows 8.1 and later and Windows Server 2012 and later.

wmic useraccount get name,sid alternative in Windows 11

Older guides use wmic useraccount get name,sid. Microsoft deprecated WMIC in Windows 10 version 21H1, and its August 2026 update states WMIC is removed and no longer offered as a Feature on Demand on Windows 11, version 24H2 and later.

Old WMIC command PowerShell replacement Why
wmic useraccount get name,sid Get-CimInstance -ClassName Win32_UserAccount | Select-Object Name, SID Same WMI class, read through PowerShell instead of WMIC
wmic useraccount where name='jsmith' get sid Get-LocalUser -Name jsmith | Select-Object SID Shortest route for one local account
wmic useraccount where sid='S-1-5-...' get name Get-LocalUser -SID S-1-5-... Takes the SID directly and returns the account
wmic group get name,sid Get-LocalGroup | Select-Object Name, SID Lists local groups with their SIDs

Well-known SIDs list in Windows

Well-known SIDs are the same on every Windows installation, so you can recognise them without running a lookup. In entries marked domain, that part is replaced by the domain or machine identifier.

SID Name What it identifies
S-1-1-0 Everyone (World) A group that includes all users
S-1-5-11 Authenticated Users All users and computers that have authenticated, excluding Guest
S-1-5-18 System (LocalSystem) The operating system and services that run as LocalSystem
S-1-5-19 LocalService Services with limited local rights and anonymous network access
S-1-5-20 NetworkService Services with limited local rights that use the computer's identity on the network
S-1-5-32-544 Administrators The built-in Administrators group
S-1-5-32-545 Users The built-in Users group
S-1-5-32-546 Guests The built-in Guests group
S-1-5-32-555 Remote Desktop Users Members can sign in remotely
S-1-5-domain-500 Administrator The built-in Administrator account of a PC or domain
S-1-5-domain-501 Guest The built-in Guest account
S-1-5-domain-512 Domain Admins Global group that administers the domain
S-1-5-domain-513 Domain Users Global group of every user in the domain

SID cannot be translated to a name in PowerShell

IdentityNotMappedException: Some or all identity references could not be translated

Windows found no account for that SID or name, usually because the account was deleted or belongs to a domain the PC cannot reach.

  1. Check that you copied the whole SID, including the final RID after the last hyphen.
  2. Run the lookup again on a PC joined to the domain that owns the SID, or on a domain controller.
  3. If the domain part matches your domain but nothing resolves, treat it as a deleted account: its SID is never reused, so permissions that list it can be removed.

Get-ADUser is not recognized as the name of a cmdlet

The Active Directory module is not installed on this PC.

  1. Open Settings > System > Optional features.
  2. Add RSAT: Active Directory Domain Services and Lightweight Directory Services Tools.
  3. Close and reopen PowerShell, then run the command again.

Get-LocalUser is not recognized or the LocalAccounts module will not load

The command is running in 32-bit PowerShell on 64-bit Windows, where the module is unavailable.

  1. Close the current window.
  2. Open Windows PowerShell or Terminal from the Start menu rather than the (x86) shortcut.
  3. Run Get-LocalUser again.

'wmic' is not recognized as an internal or external command

WMIC is removed from Windows 11, version 24H2 and later.

  1. Open PowerShell.
  2. Use Get-CimInstance -ClassName Win32_UserAccount | Select-Object Name, SID in place of the WMIC command.
  3. Use the replacement table above for other WMIC SID commands.

SID to username FAQ

How do I find my own SID in Windows 11?

Open Command Prompt or PowerShell and run whoami /user. Windows prints your DOMAIN\username and the SID of the account you are signed in with. Add /fo list if the SID is cut off in the table view.

How do I find the SID of another local user?

Run Get-LocalUser -Name "username" | Select-Object Name, SID in PowerShell. To see every local account at once, run Get-LocalUser | Select-Object Name, SID. Use 64-bit PowerShell, because the module does not load in the 32-bit version.

How do I convert a SID to a username in PowerShell?

Cast the SID to the SecurityIdentifier class and translate it: ([System.Security.Principal.SecurityIdentifier]"S-1-5-…").Translate([System.Security.Principal.NTAccount]).Value. The result is the DOMAIN\name of the user or group that owns the SID.

How do I get a user's SID from Active Directory?

Run Get-ADUser -Identity username | Select-Object Name, SID. The cmdlet is part of the Active Directory module, which comes with RSAT on Windows 11 and 10 Pro or Enterprise and is already present on domain controllers.

What is the difference between the machine SID and the domain SID?

The machine SID is the identifier shared by all local accounts on one PC. The domain SID is the identifier shared by all accounts in an Active Directory domain. Each account SID is one of these followed by the account's relative identifier.

What does S-1-5-32-544 mean?

S-1-5-32-544 is the well-known SID of the built-in Administrators group. It is the same on every Windows installation: 5 is NT Authority, 32 is the Builtin domain and 544 is the Administrators relative identifier.

Why does a SID show instead of a name in folder permissions?

Windows shows the raw SID when it cannot resolve it to an account. The account was usually deleted, or it belongs to a domain the PC cannot contact. Deleted SIDs are never reused, so a new account with the same name does not regain that access.

Can two users have the same SID?

No. Windows never issues the same SID twice within its scope and never reuses SIDs from deleted accounts. Well-known SIDs such as Everyone are identical across computers by design, because they identify generic groups rather than individual accounts.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

Your email address will not be published. Required fields are marked *