I'm trying to figure out how to query AD using LDAP but passing multiple sAMAccountNames. My LDAP query works fine if I am passing one but I guess I am trying to figure out how to pass these as an array to grab their email addresses from AD. I should be
able to work the C# code part out, I just need help with the LDAP query. Thanks all!
I figured it out. I took my existing helper class for AD lookups and then I pipe each username in with a foreach, writing the returned value each time to a string variable. If someone here gets stuck trying to do this, PM me and I'll share my sanitized code.
All-Star
35218 Points
9955 Posts
Moderator
Query AD using LDAP with Multiple sAMAccountNames?
Aug 15, 2017 08:29 PM|bbcompent1|LINK
I'm trying to figure out how to query AD using LDAP but passing multiple sAMAccountNames. My LDAP query works fine if I am passing one but I guess I am trying to figure out how to pass these as an array to grab their email addresses from AD. I should be able to work the C# code part out, I just need help with the LDAP query. Thanks all!
All-Star
35218 Points
9955 Posts
Moderator
Re: Query AD using LDAP with Multiple sAMAccountNames?
Aug 16, 2017 01:46 PM|bbcompent1|LINK
I figured it out. I took my existing helper class for AD lookups and then I pipe each username in with a foreach, writing the returned value each time to a string variable. If someone here gets stuck trying to do this, PM me and I'll share my sanitized code.