I can really see benefit if you add two more functions like IsMemberOf("sales") IsComputerInOU("OU=.EMEA,CN=Domain,CN=COM") The first one is easy to explain. Function return true or false if the user is a member of group "sales". This also includes nested groups. Second one I'm open for discussion/alternatives. Let’s say computer belongs to OU=Malmo,OU=Sweden,OU=EMEA,CN=domain,CN=com then the function will return true. All OUs inside domain.com\emea\* will return true. If you don't want to include all, you have to include this in your query (OU=Malmo,OU=Sweden,OU=.EMEA,CN=Domain,CN=COM). It would also be simpler if you don't have to include the hole path. A simple "OU=Malmo,OU=Sweden" should do fine. This way you could also query for a computer like so "CN=computername" Perhaps its better if you add support for a second optional argument to the function. This argument will decide if query string is partial or full. Or even better add wildcard support like "*searchforthis*"