On Tue, Jul 3, 2012 at 4:09 PM, Michael Oke, II <[email protected]> wrote:
> Anyone have any tools or libraries that would allow is to validate a login
> against the AD tree? Windows Server 2008.
>
>
> Michael Oke, II
> 661-349-6221
I am brain dead but if I understand what you want, this should get you
pointed in the right direction. See below sig.
--
Matt Jarvis
Eugene, Oregon USA
Function VerifyGroupMembers( strDomain, strGroup, strMemberList )
VerifyGroupMembers = False
Set objGroup = GetObject("WinNT://" & strDomain & "/" & strGroup & ",group")
arrUsers = Split( strMemberList, "," )
For Each objUser In objGroup.Members
' WScript.Echo "Checking group member " & objUser.Name
bMemberFound = False
For i = 0 To UBound( arrUsers )
If( UCase( Trim( arrUsers(i) ) ) = UCase( Trim(
objUser.Name ) ) ) Then
WScript.Echo "Member found: " & objUser.Name
bMemberFound = True
exit function
'Exit For
End If
Next
If( Not bMemberFound ) Then
' WScript.Echo "Member NOT found: " & objUser.Name
VerifyGroupMembers = False
' Exit Function
End If
Next
VerifyGroupMembers = bMemberFound
' VerifyGroupMembers = True
End Function
' ****************************************************************************
' Main
' ****************************************************************************
Do
strDomain = inputbox( "Please enter the domain name.", "Input" )
Loop until strDomain <> ""
Do
strGroup = inputbox( "Please enter the name of the group you want
to check (for instance: Domain Admins).", "Input" )
Loop until strGroup <> ""
Do
strMembers = inputbox( "Please enter all domain admin members,
separated by ','", "Input" )
Loop until strMembers <> ""
If( VerifyGroupMembers( strDomain, strGroup, strMembers ) = True ) Then
WScript.Echo "Check successfull"
Else
WScript.Echo "Check failed"
End If
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/capt54ranj65tmi_zmq5wn+mgrnfo_zeuxxqbpaxsw1mqlx1...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.