I presume that @priv will show what the user is towards the domain.
BTW, tested my suggestion and as far as I can see, it works, if
- OS = English
- OS = NT (no 9x)
- Administrators group has NOT been renamed
The LocalAdmin() UDF will resolve these issues.
But pay attention to the fact that the LocalAdmin() UDF is NOT NoVarsInStrings compliant.
Change it to
 Code:
Function LocalAdmin()
	$LocalAdmin=InGroup(@wksta+'\'+SIDToName('S-1-5-32-544'))-1+@inwin
EndFunction