Home All Groups Group Topic Archive Search About
Author
25 Aug 2005 11:18 PM
tangolp
I'm building a windows application in csharp and I'd like to know if there is
a way to filter the search by the user email address in AD?  Thanks!

Author
26 Aug 2005 1:11 AM
Joe Kaplan (MVP - ADSI)
The filter would look like:

(mail=u***@domain.com)

This assumes you want to find the user by their email address.  If you want
to find the user's email address and know the login name or something, the
filter would be different.

Joe K.

Show quoteHide quote
"tangolp" <tang***@discussions.microsoft.com> wrote in message
news:2C007A43-7FA2-485C-BAF6-972233159FEF@microsoft.com...
> I'm building a windows application in csharp and I'd like to know if there
> is
> a way to filter the search by the user email address in AD?  Thanks!
Author
26 Aug 2005 5:03 PM
tangolp
Thank you Joe for your reply.

Is it possible to get the user AD information like groups, first name, last
name, etc.. by passing only the user id?  Or I need user id and password? 
Any code sample would be helpful.  Thanks.

Show quoteHide quote
"Joe Kaplan (MVP - ADSI)" wrote:

> The filter would look like:
>
> (mail=u***@domain.com)
>
> This assumes you want to find the user by their email address.  If you want
> to find the user's email address and know the login name or something, the
> filter would be different.
>
> Joe K.
>
> "tangolp" <tang***@discussions.microsoft.com> wrote in message
> news:2C007A43-7FA2-485C-BAF6-972233159FEF@microsoft.com...
> > I'm building a windows application in csharp and I'd like to know if there
> > is
> > a way to filter the search by the user email address in AD?  Thanks!
>
>
>
Author
26 Aug 2005 5:19 PM
Joe Kaplan (MVP - ADSI)
It is possible to search for the user in AD given only their username and
you can get all of this information (although groups can be tricky).

However, you need a security context that has rights to access AD.  If you
want to access AD using the user's own security context, you either need
their plain text credentials or a Windows security token that you can use to
impersonate them and access AD.  If you want to use a different account to
access AD, then any valid service account that has the rights you need will
do.

So, it depends on what your model for accessing AD is.

There are lots of code samples in the System.DirectoryServices SDK topic in
MSDN.

Joe K.

Show quoteHide quote
"tangolp" <tang***@discussions.microsoft.com> wrote in message
news:627BCDDA-0965-4A3F-9CCA-FC90EEDA061D@microsoft.com...
> Thank you Joe for your reply.
>
> Is it possible to get the user AD information like groups, first name,
> last
> name, etc.. by passing only the user id?  Or I need user id and password?
> Any code sample would be helpful.  Thanks.
>
> "Joe Kaplan (MVP - ADSI)" wrote:
>
>> The filter would look like:
>>
>> (mail=u***@domain.com)
>>
>> This assumes you want to find the user by their email address.  If you
>> want
>> to find the user's email address and know the login name or something,
>> the
>> filter would be different.
>>
>> Joe K.
>>
>> "tangolp" <tang***@discussions.microsoft.com> wrote in message
>> news:2C007A43-7FA2-485C-BAF6-972233159FEF@microsoft.com...
>> > I'm building a windows application in csharp and I'd like to know if
>> > there
>> > is
>> > a way to filter the search by the user email address in AD?  Thanks!
>>
>>
>>