Javascript – How to use Javascript to check active directory to see if a user is in a memberof a particular group


I have at my disposal Javascript and Classic ASP. Using these two how can I check to see if a user is a member of a particular active directory group? I know VBSCRIPT has memberof function but I can only use javascript. Any help is appreciated

Best Solution

You'll need to ensure that your web server is set to use Windows Authentication. Then you can use Request.ServerVariables("LOGON_USER") to get the current user's domain\username.

You'll then query Active Directory using ADSI to get group membership.

Here's a link to msdn's ADSI pages.

This page has some sample scripts (in vbscript)