I'm trying to determine if the user logging in has admin rights, mainly for tracking purposes. Since we have UAC turned on, even when an admin signs in @priv reports "user" or "guest." I've tried using the alternative mentioned here: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=84156 but it's not working when executed during the logon. The event log reports the following:

"Failed to get API pointers Error : The specified procedure could not be found. (0x7f/127)"

However, if I run the script from a command line once the user is logged in it works fine (even without elevated permissions). Here is the test script:

 Code:
function LocalAdmin()
    IF INGROUP(UCASE(@WKSTA) + "\Administrators")
        $LocalAdmin=1
    ELSE
        $LocalAdmin=0
    ENDIF
endfunction

if @PRIV = "ADMIN"
    $priv = "ADMIN"
else
    if LocalAdmin = 1
        $priv = "ADMIN"
    else
        $priv = "USER"
    endif
endif


edit: Just wanted to add that the script also works fine on XP pro (32bit) computers.


Edited by syntax53 (2012-09-06 10:08 PM)