I have a fairly short script that takes a long time(approximately 2.5 minutes) to execute. I will be useing this as a logon script so I am obviously concerned about the execution time.
In the script I have 1 IF InGroup and approximately 5 If Exists. This script will grow to a MUCH LARGER size before I am finished.

I am wondering if this is an average execution time for this size script. Is it possible that most of my time is taken up with the group chacheing?

I did notice that if I 'short circuited' the If InGroup statement it took 1.5 minutes off my execution time. If InGroup is one of the culprits would I get better execution time using my own array for getting the groups?

Also, Any tips on increaseing speed will help drasticly. Even if it is rearrangeing the script in certain ways to help the exe 'compile' it quicker.

PS. This script is very likely to have tons of InGroups in it.