KixTart – Finding out if a user is admin

Written by James McDonald

August 22, 2008

There is supposed to a macro @PRIV that will return if the user running the kixtart script is an admin or not.

However if you have given yourself local Administration priveleges by adding a domain group you are a member of to the local Administrators Group then @PRIV won’t pick it up and will return “USER”

So reading this thread gave me the idea to try for a ADMIN$ share check. Here is the Kix code:

if Exist("\\" + @WKSTA + "\ADMIN$\System32")

? "User is admin"


? "User NOT admin"

; this is the PRIV macro

Result of running the above code you can see that the test for the admin share and system32 returns a positive for being of sufficient priveleges. But the @PRIV macro can’t determine the user is an ADMIN.

User is admin


Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…