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"

else

? "User NOT admin"

endif
; this is the PRIV macro
@PRIV

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
USER

0 Comments

Submit a Comment

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

You May Also Like…