Get userID from Active Directory.

L

Lin Ma

I first post this to win2000.active_directory group and I find out it may be
a wrong group.

I hope this group can help me.


Hello,

In ASP page, does any one knows how to get user network login ID from user
email address?

In my company, we use win 2000 server with active directory.

In my ASP page, when input an email address, I need search to find the user
network login ID.

How to do this?

Thanks for your help.

Lin Ma
 
R

Ray at

Is using Windows authentication on your site an option instead? If you
enable that, you will get DOMAIN\username in
REquest.ServerVariables("LOGON_USER").

Ray at work
 
L

Lin Ma

Ray,

Thanks for the response.

Unfortunately, the logon user is querying other user's network ID by their
email address. So the Request.ServerVariables("LOGON_USER") will not working
at this case.

Any other idea please?

Thanks,

Lin Ma
 
R

Ray at

Ah, I see.

If it were on my network, the person's username would simpy be:

sEmailAddress = "(e-mail address removed)"
aUsername = Split(sEmailAddress & "@", "@")
sUsername = aUsername(0)

Maybe you could create a MAPI session and use the resolve method. ?

Ray at work
 
L

Lin Ma

Ray,

Thanks for this try. But the user ID is not formatted the same way because
we merged with other company.

we keep the same email format which is (e-mail address removed)

Like my user id is MAL (lastname and firstname initial), but my email is
(e-mail address removed)

Others use firstname.lastname as network logon ID.

And some other format.

Any other idea? thanks a lot for the help.

Lin Ma
 
R

Ray at

Perhaps asking in m.p.active.directory.interfaces would yield better
responses. I wouldn't mention that you want to do this in ASP. Just ask
how to do it in VBS or JS or any language for that matter.

Ray at work
 
L

Lin Ma

Ray,

Thanks for the tries and the direction.

I will post a question in that group.

Have a blessing day.

Lin Ma
 
M

MSFT

Hi Lin,

I think you may perform some LDAP query in your ASP page to check the user
account. You may refer to following articles on this:

HOW TO: Use ADSI to Access Exchange User Data from an ASP Page
http://support.microsoft.com/default.aspx?scid=KB;EN-US;253568

HOWTO: Find Mail/Mailbox-Enabled Users in the Active Directory
http://support.microsoft.com/default.aspx?scid=KB;EN-US;252650

Hope this hlepful,


Luke
Microsoft Online Partner Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top