Perhaps these two functions (for use in an ASP page) can help. Not sure if
there are Domain Admin user groups.
Watch out for line wrap on the longer lines.
' Authenticates a user name and password for a given domain.
Function AuthenticateUser(sDomain, sUserName, sPassword)
Dim bRetVal
Dim oADSObject
Dim sADSNamespace
Dim oADSNamespace
Dim sADSPath, iFlags
On Error Resume Next
sADSPath = "WinNT://" & sDomain
iFlags = 0 ' 1 = Secure Authentication Flag
' Bind to the ADSI object and authenticate Username and password
Set oADSObject = GetObject(sADSPath)
sADSNamespace = left(sADSPath, instr(sADSPath, ":"))
Set oADSNamespace = GetObject(sADSNamespace)
Set oADSObject = oADSNamespace.OpenDSObject(sADSPath, sUserName,
sPassword, 0)
' We're only bound if err.number = 0
If Not (Err.number = 0) Then
' Failed to bind to object. Cannot authenticate user.
bRetVal = False
Else
' User authenticated.
bRetVal = True
'Response.Write("Currently viewing object at <b>" &
oADSObject.ADsPath & "</b><br />")
'Response.Write("Class is " & oADSObject.Class & "<br />")
End If
Set oADSObject = Nothing
Set oADSNamespace = Nothing
AuthenticateUser = bRetVal
End Function
' Determines whether or not a specified user name
' exists in the specified group in the specified Domain.
Function UserIsInGroup(sUser, sGroupName, sDomainName)
UserIsInGroup = False
If InStr(1, sUser, "\", vbTextCompare) > 0 Then
sUser = Right(sUser, Len(sUser) - InStrRev(sUser, "\"))
End If
If InStr(1, sUser, "/", vbTextCompare) > 0 Then
sUser = Right(sUser, Len(sUser) - InStrRev(sUser, "/"))
End If
Dim oGroup, oMember
On Error Resume Next
Set oGroup = GetObject("WinNT://" & sDomainName & "/" & sGroupName)
If Err.number <> 0 Then Exit Function
On Error Resume Next
For Each oMember in oGroup.Members
If UCase(Trim(oMember.Name)) = UCase(Trim(sUser)) Then
UserIsInGroup = True
Set oMember = Nothing
Set oGroup = Nothing
Exit Function
End If
Next
Set oMember = Nothing
Set oGroup = Nothing
End Function
-----Original Message-----
From: Hoenig, Robert [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 9:24 AM
To: [EMAIL PROTECTED]
Subject: [wdvltalk] Username and password
On our corporate intranet I would like to have the ability to login to a
specific area without logging into the computer as an admin. I don't want
the pop up, I would like to incorporate username and password fields on the
page and then a login in button. Once submitted the script will go out to
the network and check the credentials and then log the person if they are
cleared. Can this be done easily?
Thanks in advance
Robert
The information in this electronic mail message is sender's business
Confidential and may be legally privileged. It is intended solely for the
addressee(s). Access to this Internet electronic mail message by anyone
else is unauthorized. If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be taken
in reliance on it is prohibited and may be unlawful.
The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent. This message and
its attachments could have been infected during transmission. By reading
the message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects. Galileo International is not liable for any loss or damage
arising in any way from this message or its attachments.
____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED]
Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
http://wdvl.internet.com/WDVL/Forum/#sub
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.