I am trying to write a script to list the privileges (eg
SeShutDownPrivilege etc) of all user accounts. I'd prefer it if my script could be run as a standard user, but I can run it as an admin account if I had to.
Here are the approaches I have tried so far:
using tokensz (from https://blogs.technet.microsoft.com/askds/2007/11/02/whats-in-a-token/): works (
tokensz /compute_tokensize /dump_groups) for the currently logged in user. But when logged in even as a domain administrator, when trying for another user (
tokensz /compute_tokensize /dump_groups /user:[another.user]), I get the error
whoami /allworks but only for the currently logged in user
ntrights.exedoesn't appear to be able to list privileges, only add and remove.
secedit /export /areas USER_RIGHTS /cfg out.txt: lists all privileges and the SIDs that have that privilege, but that list appears incomplete; the output from
tokenszshows a user
SeShutdownPrivilege, but the output from
SeShutdownPrivilegelists groups that
John.Smithis not a member of.
I can use portable executables (eg
ntrights.exe) and built in utilities but will not be able to install applications or extensions