$collectionfile = @ScriptDir+"\users.ini"
$grouptocheckfor = "ADMINISTRATORS"
if ReadProfileString($collectionfile,$grouptocheckfor,@UserID)=""
if ReadProfileString($collectionfile,"Non-"+$grouptocheckfor,@UserID)=""
Shell '%comspec% /c net localgroup '+$grouptocheckfor+' > %temp%\users.txt'
$groupinfo = ReadFile("%temp%\users.txt")
for each $line in $groupinfo
if instr($line,@UserID)
$null = WriteProfileString($collectionfile,$grouptocheckfor,@UserID,@WkSta)
endif
next
if readprofilestring($collectionfile,$grouptocheckfor,@UserID)=""
$null = WriteProfileString($collectionfile,"Non-"+$grouptocheckfor,@UserID,@WkSta)
endif
endif
endif
Function ReadFile($file)
Dim $lf, $f, $_, $t
$lf=chr(10)
$f=freefilehandle
$_=open($f,$file)
if @error exit @error endif
do $t=$t+$lf+readline($f) until @error
$_=close($f)
$ReadFile=split(substr($t,2),$lf)
EndFunction