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

15,593

Solution 1

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. http://msdn.microsoft.com/en-us/library/aa772170%28v=vs.85%29.aspx

This page has some sample scripts (in vbscript)

Solution 2

As far as I know there is no possibility to access activeDirectory by using Javascript. Javascript runs within the browser - and may not access anything out of this sandbox.

In case I misunderstood your question und you ment server-side checking - use ASP functions to check for.

Share:
15,593
Roy Rideaux
Author by

Roy Rideaux

Updated on June 04, 2022

Comments

  • Roy Rideaux
    Roy Rideaux almost 2 years

    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