Mark B
2008-06-08 00:44:11 UTC
Hi,
I need to search AD for users, based on a text string entered by the Admin
in to my program.
Can I do
"(&(objectClass=user)(sAMAccountName=" & SearchString & "*)(SN=" &
SearchString & "*)(GivenName=" & SearchString & "*))"
Note that I want want to OR these search terms.
If SearchString = sAMAccountName or SN or GivenName
... then add it to the list.
What would be the syntax if I COULD do it? I'm worried about that & at the
front that might mean where object class = User AND
sAMAccountName=SearchString.
Any help appreciated.
In my previous (VB6) version, I was issuing an SQL type query. I'd prefer to
stick with pure .NET, this time around, if possible.
Mark
I need to search AD for users, based on a text string entered by the Admin
in to my program.
Can I do
"(&(objectClass=user)(sAMAccountName=" & SearchString & "*)(SN=" &
SearchString & "*)(GivenName=" & SearchString & "*))"
Note that I want want to OR these search terms.
If SearchString = sAMAccountName or SN or GivenName
... then add it to the list.
What would be the syntax if I COULD do it? I'm worried about that & at the
front that might mean where object class = User AND
sAMAccountName=SearchString.
Any help appreciated.
In my previous (VB6) version, I was issuing an SQL type query. I'd prefer to
stick with pure .NET, this time around, if possible.
Mark