all groups > dotnet security > august 2005 >
You're in the

dotnet security

group:

Get the user email


Get the user email tangolp
8/25/2005 4:18:01 PM
dotnet security:
I'm building a windows application in csharp and I'd like to know if there is
Re: Get the user email Joe Kaplan (MVP - ADSI)
8/25/2005 8:11:15 PM
The filter would look like:

(mail=user@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.

[quoted text, click to view]

Re: Get the user email tangolp
8/26/2005 10:03:05 AM
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.

[quoted text, click to view]
Re: Get the user email Joe Kaplan (MVP - ADSI)
8/26/2005 12:19:25 PM
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.

[quoted text, click to view]

AddThis Social Bookmark Button