brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: whoami /groups and /priv show what your account can do

Security
~/tips/tip-windows-whoami-groups-priv

whoami /groups

Lists the groups your account belongs to and its security privileges.

When a command fails with access denied, the first question is who you are running as and what that account may do. whoami answers more than the name.

whoami /groups
whoami /priv

According to the documentation, /groups displays the user groups the current user belongs to, and /priv displays the security privileges of the current user. Plain whoami prints the current domain and user name, and /user adds the security identifier (SID).

For the full picture of the current access token there is /all. It combines the user name, SIDs, privileges and groups:

whoami /all /fo list

The /fo option switches the format between table (the default), list and csv. /nh removes the header for table and CSV output, which helps when you feed the result to a script.

whoami /groups /fo csv /nh

A practical use: run the same command in a normal prompt and in an elevated one, and compare the output. Differences show up directly.

One caveat: /nh works only for the table and CSV formats. Also, the documentation does not explain what each privilege name means, so look those up separately before drawing conclusions.

None of this was run on a live Windows machine here. It follows the Microsoft documentation.

Further reading: whoami

More Security tips Start-MpScan -ScanType QuickScan tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin All Security tips (77) All topics

Link