For some time now I have been using ingroup in my login script to determine Local Administrative rights. For some reason in our enviornment ingroup takes a considerable amount of time especially at remote locations. After digging into my old batch goodie bag I came up with the following section to add to my script. It has made a tremendous difference for determining local administrative rights. If your enviornment doesnt add users to the local administrators group you wont see any difference.
Code:
Shell '%comspec% /c net localgroup administrators | find /i "@USERID" > nul'
If @error = 0
$LoAdmin = "TRUE"
Else
If InGroup("\\" + @WKSTA + "\Administrators") = 1
$LoAdmin = "TRUE"
EndIf
EndIf
_________________________
WonderBoy
Constantly learning everyday, how much I dont know :-)