Check if user is in Group (ldap adsi WIN NT)

I know:
Name of server is DIP
Name of Group is Farm_group

I need a page with code in ASP classic NO NET!...
create a page in ASP with a box and button.
In the box the user insert the username and after pressing the button controll if the user is in Group on AD Winnt server.

If user is in group goto OK_page.asp if thje user not is in group appera message yopu noet are in "Farm_Group , access denied"

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

See if this example project fits what you need:
sal21Author Commented:
Hi ddrudik, tks for link...
But i want to check user in specific group not username and password in winnt ad....
I believe it will require an ActiveX module to accomplish this with Classic ASP, this one seems to fit your requirements:

They have a trial download you might want to try out to verify it works for you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

sal21Author Commented:
Peraphs solved 85% with the code here...

1) but ho to read via code the name of user logged and assing to the var  sUserName...instead  "oi24683"

2) ho to show message in asp page if, after the select case not have success

<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nuova pagina 1</title>


Set oNetwork = CreateObject("WScript.Network")

sDomain = "DIP"
sUserName = "OI24683"

'sUserName = oNetwork.UserName
'sUserName = request.servervariables("AUTH_USER")

Set oUser = GetObject("WinNT://" & sDomain & "/" & sUserName & ",user")

For Each oGroup In oUser.Groups
Select Case(oGroup.Name)
    Case "InpdapNAXX"
    Case "Group B"
    Case "Group C"
    Case "Group D"
End Select


1.For request.servervariables("AUTH_USER")  to work try unticking "Integrated Windows Authentication" in the same area where you untick anynomous access.

MS seems to think that this is the only solution:
Accessing the Request.ServerVariables("LOGON_USER") variable from Active Server Pages (ASP) returns an empty string.

The LOGON_USER variable is not populated if the ASP page is accessed using Allow Anonymous security.

In order for the LOGON_USER variable to be populated, the user must be authenticated using either Basic or NT Challenge/Response security.

2. USe
Case else
response.write "no redirection"
sal21Author Commented:

Now i think.
Is possible to adjust the script in this mode:
insert 2 box in asp page:

authetnticate the user in domain, if the user with user name and password is authenticate use the filed of username to fill the var susername var....

Wath you think about?

naturally use attention message if user and password not are matched...
First let me know if the suggestions are working
sal21Author Commented:
ok ....
But understand my suggestion?
(my english is a napolitan english)
Ok. Lets try to fix your current problems and then we can always enhance it
sal21Author Commented:
Tks for patience.
Pizza are ready for you.
what about hot wings ?
sal21Author Commented:
just found tath and it work on my domain:
<form method="post">  
      <table align="center" border="0" cellpadding="5" cellspacing="0" width="400">
            <td align="right">Domain:</td>
            <td><input type="text" size="30" name="domain" value="" /></td>
            <td align="right">User:</td>
            <td><input type="text" size="30" name="username" value="" /></td>
            <td align="right">Password:</td>
            <td><input type="password" size="30" name="password" value="" /></td>
            <td align="center" colspan="2"><input type="submit" value="Login" name="cmdLogin" /></td>

On Error Resume Next
If Request.Form <> "" Then
      strUserName = Request.Form("username")
      strPassword = Request.Form("password")
      strDomain = Request.Form("domain")
      strADsPath = "WinNT://" & strDomain
      Set oADsObject = GetObject(strADsPath)
      Set oADsNamespace = GetObject("WinNT:")
      Set oADsObject = oADsNamespace.OpenDSObject(strADsPath, strDomain & "\" & strUserName, strPassword, 0)
      If Err.Number = 0 Then              
        Response.Write "<h2>Authenticated</h2>"        
        Response.Write "<h2>Login Failed</h2>"
      End If
End If
sal21Author Commented:
Not uset the box domain i want to isert to the defaul in script....
>>Not uset the box domain i want to isert to the defaul in script....

Sorry didn't understand your 'napolitan english'.Could u explain more
sal21Author Commented:
Hi jitganguly not consider last note: Not uset the box domain i want to isert to the defaul in script....
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.