See Your Current Windows Logon Groups
This guide shows you how to list the security groups your current Windows logon session belongs to. You’ll see both the groups assigned directly to your user account and those inherited through domain or local group membership. No administrative rights are required for the basic methods, though some details (like nested groups) may need elevated access.
What You’ll Need
- A Windows PC (Windows 10 or 11 recommended, but works on older versions).
- Your user account must be logged on (you’re already using it).
- For domain accounts: access to a domain-joined computer or the ability to run a command with your domain credentials.
- Optional: PowerShell or Command Prompt (both come with Windows).
Step-by-Step
- Open Command Prompt or PowerShell.
- Press Win + R, type
cmdorpowershell, and press Enter. - Or search for “Command Prompt” or “PowerShell” in the Start menu and click it.
- Press Win + R, type
- Run the
whoami /groupscommand.- Type
whoami /groupsand press Enter. - You’ll see a table with columns: Group Name, SID, Attributes, and (if applicable) a “Mandatory” label.
- The “Group Name” column lists all groups your current token includes, such as
Everyone,BUILTIN\Users, and your domain groups.
- Type
- Interpret the output.
- Groups with “Mandatory” in the Attributes column are always present (e.g.,
Everyone). - Groups with “Enabled by default” are active.
- Groups with “Enabled group” are active but not necessarily used for access checks (e.g.,
Everyone). - Groups with “Group used for deny only” are used only to deny access.
- Groups with “Mandatory” in the Attributes column are always present (e.g.,
- For a cleaner list (optional).
- If you want just the group names, use:
whoami /groups | findstr /i "group"(in cmd) orwhoami /groups | Select-String -Pattern "Group"(in PowerShell). - This filters out the header and SID columns.
- If you want just the group names, use:
- Check your user account’s group memberships (alternative).
- Open Command Prompt as your normal user and type:
net user %username%. - Look for the “Local Group Memberships” and “Global Group memberships” lines. These show groups assigned directly to your account, but not inherited groups.
- This method is less complete than
whoami /groupsbecause it doesn’t show groups from the local computer’s built-in groups or domain groups that are applied via “Domain Users” etc.
- Open Command Prompt as your normal user and type:
- Use PowerShell’s
Get-ADPrincipalGroupMembership(domain accounts only).- If your computer is domain-joined and you have the Active Directory module, run:
Get-ADPrincipalGroupMembership $env:USERNAME | Select-Object Name. - This lists all groups the account belongs to in Active Directory, but requires the RSAT tools or AD module installed. It also doesn’t include local groups.
- If the module isn’t available, you can use:
net user %username% /domainto see domain group memberships.
- If your computer is domain-joined and you have the Active Directory module, run:
- Check the GUI (optional).
- Open Computer Management (right-click Start > Computer Management).
- Go to System Tools > Local Users and Groups > Groups.
- Double-click a group to see its members. This shows who is in each local group, but you have to check each group manually—it’s not a quick list of your groups.
- For your own account, you can also go to Local Users and Groups > Users, double-click your account, and go to the Member Of tab. This shows only the groups directly assigned, not inherited ones.
Common Mistakes
- Using
net userand thinking it shows all groups. It only shows groups directly assigned to the account, not groups the account inherits via domain or local built-in groups (e.g.,Everyoneis never listed). - Running
whoami /groupsin an elevated prompt and expecting the same result as a normal prompt. If you run as Administrator, your token includes additional groups (likeBUILTIN\Administrators) that are not present in a normal session. Always run the command in the same context you want to check. - Forgetting that group membership changes require a new logon. If you were just added to a group, your current session won’t show it until you log off and on again.
- Misreading “Enabled” vs “Enabled by default”. “Enabled” means the group is active in the token, but “Enabled by default” is just the default state; it doesn’t mean the group is actually used for access checks—some groups are enabled but not used unless specifically referenced.
Tips
- Use
whoami /groups /fo listto see the output in a list format that might be easier to read. - If you need to see the SID of a group (e.g., for scripting), the SID column in
whoami /groupsis there. - For a quick check in PowerShell, you can also use:
([System.Security.Principal.WindowsIdentity]::GetCurrent()).Groups | ForEach-Object { $_.Translate([System.Security.Principal.NTAccount]).Value }to get group names in a cleaner list. - Remember that group membership is evaluated at logon. If you want to test a new group without logging off, you can use
runas /user:domain\user cmdand then runwhoami /groupsin that new window—but that requires you to know the password.
Troubleshooting
- “whoami” is not recognized as an internal or external command. This is rare, but if it happens, you’re likely not in a command prompt. Make sure you’re typing in Command Prompt or PowerShell, not in a file dialog.
- The output is empty or only shows “Everyone”. This can happen if your user profile is corrupted or if you’re running in a restricted environment (like a PE boot). Try logging off and on, or run
whoami /allto see if more details appear. - You don’t see domain groups even though you’re on a domain. Make sure you’re logged on with a domain account, not a local account. Check with
whoami; if it showscomputername\username, it’s a local account. Switch to a domain account. - You get an “Access denied” error when using
net user /domain. That command requires domain admin privileges or at least permission to read user information. Usewhoami /groupsinstead—it works without special rights. - PowerShell says
Get-ADPrincipalGroupMembershipis not recognized. The Active Directory module isn’t installed. Install RSAT (Remote Server Administration Tools) from Windows Features, or use thenet userorwhoamimethods instead.
Frequently Asked Questions
- Why does
whoami /groupsshow more groups thannet user?
Becausewhoami /groupsshows the actual token of your current logon session, which includes all groups the system has added based on your account, local groups, and domain groups.net useronly lists the groups explicitly assigned to your user object, not the inherited ones. - Can I see groups for another user?
Yes, but you need administrative rights. You can usenet user username /domainfor domain accounts (if you have permission), or open Computer Management and look at the user’s properties. For a full token view of another user, you’d need to run a command as that user (e.g.,runas) or use advanced tools like Sysinternals’PsExecwith the-uflag. - Why do I see “Mandatory” groups like
Everyone?
These are well-known SIDs that Windows adds to every token. They are used for security checks and are not actual “groups” you can manage. - I was added to a group, but
whoami /groupsdoesn’t show it. Why?
Group membership is determined at logon. You need to log off and log back on (or restart the computer) for the new group to appear in your token. If you’re using a domain account, the group must be applied to your account in Active Directory and then you must refresh your token. - Does
whoami /groupsshow nested groups?
Yes, it shows all groups that are effective in your token, including groups you are a member of through nesting (e.g., if you’re in Group A, which is in Group B, both A and B appear). However, it does not show the nesting hierarchy—just the final list. - Can I use this on Windows Server?
Yes, the same commands work on Windows Server editions. The GUI steps (Computer Management) also work, but the “Local Users and Groups” snap-in is not available on Server Core installations.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.