Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the Users Email Address 1

Status
Not open for further replies.

TStriker

Programmer
Nov 12, 2003
277
US
Hi all,

This is a rookie question for sure but how do I get the email address of the user that is visiting the page without asking them?

This is for an intranet application not a public website. All users are on the same domain and are using IE6. We are running Active Directory. This works with WSH on the local workstation but not on a web page:

dim objAdSysInfo, objUser

Set objAdSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objADSysInfo.UserName)

Wscript.Echo "SMTP Address: " & objUser.mail

Any ideas?

-Striker
 
You could turn off anonymous access in IIS. This will cause the web server to send "401 Access Denied" to the browser and then IE will automatically re-send the HTTP Request but this time it will include the domain name and username of the current windows user.

You can then view the credentials by looking at the Request.ServerVariables collection.
 
Thanks Sheco! I was able to use a different approach using your tip.

Thanks again!

-Striker
 
TStriker, how does your new approach work?
We use a library here to attach to the exchange server and do a lookup but I am always looking for a better way.


At my age I still learn something new every day, but I forget two others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top