youre welcome for the help!
no offense but im in crap mode today so here are my thoughts.
1. it only works in the context of the currently logged on user
2. everytime you want to query if a user is a member of a groups it is going to
+ create a wscript.network object
+ retrieve domainname
+ retrieve username
+ bind to a user object
+ run through a collection of groups
so, from point 1. i guess you are using this for a logon script? either way it still sucks.
lets say you want to check if the user is a member of 5 groups,,,please dont tell me you are going to call this function 5 times,,,
5 X create a wscript.network object
5 X retrieve domainname
5 X retrieve username
5 X bind to a user object
5 X run through a collection of groups
vbscript is very powerful, but also very dangerous and seriously slow when inspiration is involved ;-)