And here is an even simpler method...I don't know why I was leaving it so complicated...

 Code:
$collectionfile = @ScriptDir+"\users.ini"
$grouptocheckfor = "Utilisateurs avec pouvoir"

if ReadProfileString($collectionfile,$grouptocheckfor,@UserID)=""
   if ReadProfileString($collectionfile,"Non-"+$grouptocheckfor,@UserID)=""
      if InGroup("\\"+@WkSta+"\"+$grouptocheckfor)
         $null = WriteProfileString($collectionfile,$grouptocheckfor,@UserID,@WkSta)
      else
         $null = WriteProfileString($collectionfile,"Non-"+$grouptocheckfor,@UserID,@WkSta)
      endif
   endif
endif


Edited by CitrixMan (2011-02-18 05:13 PM)