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