To see groups attached to your current session, check its effective security token—not just a directory account record. On Windows, run whoami /groups. On Linux or Unix, run id -Gn for group names or id -G for numeric IDs. These commands report the groups available to the current process, which can differ from directory membership if the session has not refreshed.
Check your current groups from the command line
Windows
Open Command Prompt or PowerShell and run:
whoami /groups
The command lists the groups in the current Windows logon token. Microsoft describes whoami as showing information about the logged-on account’s user, groups, and privileges. To include additional token details, run:
whoami /all
The expanded output includes the current user, group SIDs, privileges, and other access-token information. Group names and SIDs are useful for different checks: names are easier to recognize, while SIDs identify the security principals represented in the token.
Linux and Unix
Run these commands without a username to inspect the current process:
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute#1 Best Overall
id -Gnprints group names.id -Gprints numeric group IDs.groupsprints group names and is equivalent toid -Gn.
The GNU Coreutils groups manual says that, without a username argument, groups reports the primary and supplementary groups for the current process. The GNU Coreutils id manual documents id‘s name and numeric output options.
Which method should you use?
| Environment | Method | What it reports | Identity being checked | Source |
|---|---|---|---|---|
| Windows | whoami /groups |
Groups in the current access token | Current logged-on identity and token | Microsoft Learn |
| Windows | whoami /all |
Groups plus user, SIDs, privileges, and other token details | Current logged-on identity and token | Microsoft Learn |
| Linux or Unix | id -Gn or groups |
Group names | Current process when no user is specified | GNU Coreutils id manual; GNU Coreutils groups manual |
| Linux or Unix | id -G |
Numeric group IDs | Current process when no user is specified | GNU Coreutils id manual |
Why the result may not show a recent membership change
These commands inspect the groups carried by the running process or its security token. They do not necessarily perform a fresh lookup of directory membership. GNU documents that process group lists are normally inherited from the parent process and are usually unchanged since login. As a result, changing a group database entry may not update a process that is already running.
Rank #2
Windows group SIDs are likewise carried in the access token. If an administrator adds an account to a group, an existing token may not reflect that change until the account receives a refreshed token—for example, after signing in again or renewing the relevant process or session. If the output appears stale, verify it from a newly created session or process after the applicable refresh.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Inspect the current identity in application code
.NET
In .NET, WindowsIdentity.GetCurrent() returns a WindowsIdentity representing the current Windows user. Enumerate its Groups collection to examine the identity references in that token. The overload with a Boolean argument lets code select the impersonating thread identity or the process identity; choose the one that matches the work being authorized.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Rank #3
See Microsoft’s documentation for WindowsIdentity.GetCurrent and WindowsIdentity.Groups.
Native Win32
For native Windows code, query the current access token with GetTokenInformation using TokenGroups, then enumerate the returned TOKEN_GROUPS array. Microsoft defines GroupCount as the number of group entries; each entry contains a SID and attributes. This is token data, not a live directory query.
Rank #4
Microsoft documents GetTokenInformation and the TOKEN_GROUPS structure.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools

