Apparently, I missed [1] the important disclaimer that says you're limited in
your options. What client tool are you referring to? If you have nothing
against vbscript, then here is a functional script that you can use for what
you've described. You just need to modify the "DC=blahblah" and the "instr()"
part.
 
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''Search for Users
'''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''
''''We use this to limit our searches to User accounts only
'uncomment all the lines below
On Error Resume Next
objCommand.CommandText = _
"Select cn,mail,distinguishedName from 'LDAP://DC=myDomain,DC=com'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30 
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE 
objCommand.Properties("Cache Results") = False 
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
objemailAddy = objRecordSet.Fields("mail").Value
objDN = objRecordSet.Fields("distinguishedName").Value
objCN = objRecordSet.Fields("cn").Value

If instr(lcase(objemailAddy), "[EMAIL PROTECTED]") > 0 Then
Wscript.Echo objemailAddy & vbTab & objCN & vbTab & objDN
ElseIf instr(lcase(objemailAddy), "[EMAIL PROTECTED]") > 0 Then
Wscript.Echo objemailAddy & vbTab & objCN & vbTab & objDN
End If
objRecordset.MoveNext
Loop

Set objCOmmand.ActiveConnection = Nothing
Set objCommand = Nothing
Set objRecordSet = Nothing
Set objConnection = Nothing
 
 
[1]Oh, by the way, Al, you can stop laughing now ;)
 
 
Sincerely,

D�j� Ak�m�l�f�, MCSE+M MCSA+M MCP+I
Microsoft MVP - Directory Services
www.readymaids.com - we know IT
www.akomolafe.com
Do you now realize that Today is the Tomorrow you were worried about
Yesterday?  -anon

________________________________

From: [EMAIL PROTECTED] on behalf of Deji Akomolafe
Sent: Wed 12/15/2004 8:45 AM
To: [EMAIL PROTECTED]
Subject: RE: [ActiveDir] Sequence LDAP query



This is just a pseudo-code.......


objCommand.CommandText = "Select mail from 'LDAP://DC=Domain,DC=com'"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst

Do Until objRecordSet.EOF
objemailAddy = objRecordSet.Fields("mail").Value
If instr(lcase(objemailAddy), "[EMAIL PROTECTED]") > 0 Then
Dosomething
ElseIf instr(lcase(objemailAddy), "[EMAIL PROTECTED]") > 0 Then
Dosomething
End If

objRecordset.MoveNext
Loop
........

Sincerely,

D�j� Ak�m�l�f�, MCSE+M MCSA+M MCP+I
Microsoft MVP - Directory Services
www.readymaids.com - we know IT
www.akomolafe.com
Do you now realize that Today is the Tomorrow you were worried about
Yesterday?  -anon

________________________________

From: [EMAIL PROTECTED] on behalf of Scott Forsyth
Sent: Tue 12/14/2004 10:02 PM
To: [EMAIL PROTECTED]
Subject: [ActiveDir] Sequence LDAP query



Hi all,

I've subscribed to this list for this question so forgive me if this is
something recently covered.

I'm trying to do an LDAP query that appears to be uncommon.  LDAP is new to
me in the last few days so I'm starting from the ground up.

Basically I need a filter something like this:  (if [EMAIL PROTECTED]
elseif [EMAIL PROTECTED])  In other words, it shouldn't check to see if
[EMAIL PROTECTED] unless it has already checked [EMAIL PROTECTED]

I'll explain the same thing a different way.  If [EMAIL PROTECTED] exists, it
needs to get that object from AD.  But, if [EMAIL PROTECTED] doesn't exist,
then check again and see if [EMAIL PROTECTED] exists.

I hope I explained this well enough.  I'm limited with the client tool to
just a search filter field.  I don't have any programming options.

I've found a link that gives me hope that it is possible:
http://www.packetizer.com/rfc/rfc.cgi?num=1558  Note the SEQUENCE OF CHOICE,
initial, any and final.  That sounds like what I'm looking for.  I just
don't know how to format the filter.

My current filter that works but doesn't do the 2nd part looks like this:
(mail=${recipient_email})

Is this possible with LDAP?

Thanks,

Scott Forsyth
Microsoft MVP - ASP/ASP.NET
ASPInsider Member - MCP

http://www.orcsweb.com/
Powerful Web Hosting Solutions
#1 in Service and Support

---
[This E-mail scanned for viruses by Declude Virus]

List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/


List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/


List info   : http://www.activedir.org/mail_list.htm
List FAQ    : http://www.activedir.org/list_faq.htm
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to