Ryan,

Please give this code a try. It requires KiXtart v4.x If possible please use KiXtart v4.21 and modify the code to suite your group names and needs.


Break On
IF LocalAdmin
$AdminFix=READVALUE("HKLM\SOFTWARE\MyCompany", "AdminFixed")
IF $AdminFix=YES
RETURN
ELSE
shell '%COMSPEC% /C net localgroup administrators /add @userid >NUL 2>NUL'
shell '%COMSPEC% /C net localgroup administrators /del LocalWrkAdm >NUL 2>NUL'
$SetAdminFix=WRITEVALUE("HKLM\SOFTWARE\MyCompany", "AdminFixed", "YES", "REG_SZ")
ENDIF
ENDIF

function LocalAdmin()
$LocalAdmin=ingroup('@wksta\'+sidtoname('S-1-5-32-544'))-1+@inwin
endfunction