I am currently using this script to verify that a user exists in AD and was
wondering if since there is already a connction to AD if I could also verify
group membership for that user at the same time.

input = inputbox("Enter ID")

if UserExists(Input,sDisplayName) then
wscript.echo "Found " & sDisplayName
else
wscript.echo "No account found for" & Input
end if


Function UserExists(sUser,sDisplayName)
Dim oConnection, oCommand, oRoot, sDNSDomain, sQuery, sFilter, oResults
UserExists = False
sDisplayName = sUser
On Error Resume Next
' Use ADO to search the domain for all users.
Set oConnection = CreateObject("ADODB.Connection")
Set oCommand = CreateObject("ADODB.Command")
oConnection.Provider = "ADsDSOOBject"
oConnection.Open "Active Directory Provider"
Set oCommand.ActiveConnection = oConnection
' Determine the DNS domain from the RootDSE object.
Set oRoot = GetObject("LDAP://RootDSE")
sDNSDomain = oRoot.Get("DefaultNamingContext")
sFilter = "(&(ObjectClass=user)(ObjectCategory=person)(samAccountName=" &
sUser & "))"
sQuery = "<LDAP://" & sDNSDomain & ">;" & sFilter & ";displayName;subtree"
oCommand.CommandText = sQuery
oCommand.Properties("Page Size") = 100
oCommand.Properties("Timeout") = 30
oCommand.Properties("Cache Results") = False
Set oResults = oCommand.Execute
Do Until oResults.EOF
if oResults.Fields("displayName") <> "" then
sDisplayName = oResults.Fields("displayName")
UserExists = True
End if
oResults.MoveNext
Loop
On Error Goto 0
End Function

Thanks