Jump to Real's How-to Main page

Check if the current user belongs a specific Windows group/role

You can connect to the ActiveDirectory or use some API but an easy way is to use a connection to SQL Server. Send the query :
SELECT is_member('mydomain\g_dept')
and the result can be
0     Current user is not a member of group or role. 

1     Current user is a member of group or role. 

NULL  Either group or role is not valid. 

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]